|
||||||||||
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 int |
CardModeASYNC
|
static int |
CardModeAT45D041
|
static int |
CardModeAT88SC
|
static int |
CardModeAT88SC102
|
static int |
CardModeI2C
|
static int |
CardModeINPHONE
|
static int |
CardModeSLE4428
|
static int |
CardModeSLE4442
|
static int |
CardModeSLE6636
|
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)
|
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 int CardModeASYNC
public static final int CardModeI2C
public static final int CardModeSLE4428
public static final int CardModeSLE4442
public static final int CardModeAT88SC
public static final int CardModeINPHONE
public static final int CardModeAT45D041
public static final int CardModeSLE6636
public static final int CardModeAT88SC102
Constructor Detail |
---|
public Reader(HardwareInterface Dev) throws java.lang.IllegalArgumentException
Dev
- HardwareInterface object which has been initialed
java.lang.IllegalArgumentException
HardwareInterface
public Reader(HardwareInterface Dev, byte slot) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
Method Detail |
---|
public void setSlot(byte slot)
slot
- slot number to manipulate.public int connect()
Error
public int setPower(int power)
power
- CCID_POWERON or CCID_POWEROFF
Error
public int close()
Error
public 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
Error
public byte[] getAtr()
public java.lang.String getAtrString()
public int getCardStatus(byte[] pStatus)
pStatus
- One byte array to get Card status.Error
public int getCmdFailCode()
public HardwareInterface getCurrentDev()
HardwareInterface
public 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.
Error
public 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 |