|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectamlib.ccid.Reader
public class Reader
| Field Summary | |
|---|---|
static byte |
CardModeASYNC
|
static byte |
CardModeSLE4428
|
static byte |
CardModeSLE4442
|
static int |
CCID_POWEROFF
|
static int |
CCID_POWERON
|
static byte |
CCID_PROTOCOL_NA
|
static byte |
CCID_PROTOCOL_T0
|
static byte |
CCID_PROTOCOL_T1
|
static byte |
SLOT_STATUS_CARD_ABSENT
|
static byte |
SLOT_STATUS_CARD_ACTIVE
|
static byte |
SLOT_STATUS_CARD_INACTIVE
|
| Constructor Summary | |
|---|---|
Reader(HardwareInterface Dev)
Constructor |
|
Reader(HardwareInterface Dev,
byte slot)
Constructor with given slot number |
|
| Method Summary | |
|---|---|
int |
close()
To close communication with ICC. |
int |
connect()
To connect to ICC. |
void |
destroy()
To clean held member in Reader. class members will be reset to null |
int |
escape(byte[] pTxBuf,
int txLen,
byte[] pRxBuf,
int[] pRxLen)
Send Escape command to ICC |
byte[] |
getAtr()
Gets the ATR bytes in hex |
java.lang.String |
getAtrString()
Gets the ATR string. |
int |
getCardStatus(byte[] pStatus)
Gets Card Status |
int |
getCmdFailCode()
To get the CCID slot error and slot status registers of last CCID command |
HardwareInterface |
getCurrentDev()
To get the current HardwareInterface instance nested in class Reader |
int |
getProtocol(byte[] pProtocol)
To get the active protocol. |
int |
getSN(byte[] pSN,
byte[] pSNLength)
To get Serial Number. |
int |
setPower(int power)
To set Card Power |
void |
setSlot(byte slot)
To set the slot number of Reader |
int |
switchMode(byte mode)
To switch to different card mode |
int |
transmit(byte[] pTxBuf,
int txLen,
byte[] pRxBuf,
int[] pRxLen)
Transmits APDU |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CCID_POWERON
public static final int CCID_POWEROFF
public static final byte SLOT_STATUS_CARD_ACTIVE
public static final byte SLOT_STATUS_CARD_INACTIVE
public static final byte SLOT_STATUS_CARD_ABSENT
public static final byte CCID_PROTOCOL_T0
public static final byte CCID_PROTOCOL_T1
public static final byte CCID_PROTOCOL_NA
public static final byte CardModeASYNC
public static final byte CardModeSLE4428
public static final byte CardModeSLE4442
| Constructor Detail |
|---|
public Reader(HardwareInterface Dev)
throws java.lang.IllegalArgumentException
Dev - HardwareInterface object which has been initialed
java.lang.IllegalArgumentExceptionHardwareInterface
public Reader(HardwareInterface Dev,
byte slot)
throws java.lang.IllegalArgumentException
Dev - slot -
java.lang.IllegalArgumentExceptionHardwareInterface| Method Detail |
|---|
public void setSlot(byte slot)
slot - slot number to manipulate.public int connect()
Errorpublic int setPower(int power)
power - CCID_POWERON or CCID_POWEROFF
Errorpublic int close()
Errorpublic void destroy()
public int transmit(byte[] pTxBuf,
int txLen,
byte[] pRxBuf,
int[] pRxLen)
pTxBuf - The data block to sent to the ICC. ( abData field in command PC_to_RDR_XfrBlock 0x6F)txLen - The length of pTxBufpRxBuf - The adData field in received packet. Refer to RDR_to_PC_DataBlock in ICC spec.pRxLen - One byte array to specify received data length in pRxBuf
Error
public int escape(byte[] pTxBuf,
int txLen,
byte[] pRxBuf,
int[] pRxLen)
pTxBuf - The data block sent to the ICC. ( abData field in command PC_to_RDR_Escape 0x6b)txLen - The length of pTxBufpRxBuf - The adData field in received packet. Refer to RDR_to_PC_Escape in ICC specpRxLen - One byte array to specify received data length in pRxBuf
Errorpublic byte[] getAtr()
public java.lang.String getAtrString()
public int getCardStatus(byte[] pStatus)
pStatus - One byte array to get Card status.Errorpublic int getCmdFailCode()
public HardwareInterface getCurrentDev()
HardwareInterfacepublic int getProtocol(byte[] pProtocol)
pProtocol - one byte array.
Its value could be CCID_PROTOCOL_T0, CCID_PROTOCOL_T1 or CCID_PROTOCOL_NA
Error
public int getSN(byte[] pSN,
byte[] pSNLength)
pSN - bytes array to store serial number.pSNLength - one byte array to indicate length of serial number.
when method returns, it denotes the actual length of serial number.
Errorpublic int switchMode(byte mode)
mode - mode to switch
Error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||