com.BTPaySDK
Class BTPay_SDK.SmartCard
java.lang.Object
com.BTPaySDK.BTPay_SDK.SmartCard
- Enclosing class:
- BTPay_SDK
public class BTPay_SDK.SmartCard
- extends java.lang.Object
Class SmartCard includes all methods for Smart card function.
Method Summary |
int |
exchangeAPDU(ResDataStruct exAPDU)
Exchange APDU between the currently selected microprocessor card in the ICC reader. |
int |
getICCReaderStatus(byte[] ICCStatus)
Get ICC Reader microprocessor card status. |
int |
powerOffICC()
Power down the currently selected microprocessor card in the ICC reader. |
int |
powerOnICC(byte m_Option,
ResDataStruct atrPPS)
Power up the currently selected microprocessor card in the ICC reader. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BTPay_SDK.SmartCard
public BTPay_SDK.SmartCard()
getICCReaderStatus
public int getICCReaderStatus(byte[] ICCStatus)
- Get ICC Reader microprocessor card status.
- Parameters:
ICCStatus
- the microprocessor card status,one bytes.
1. Bit0: 0 = ICC Power not ready, 1 = ICC Powered;
2. Bit1: 0 = Card not seated, 1 = Card seated;
3. Bit2: 0 = Latch released, 1 = Latch closed;
4. Bit3: 0 = Card not present, 1 = Card present;
5. Bit4: 0 = No magnetic data, 1 = Magnetic data present;
6. Bit5~7: all 0
- Returns:
- success or error code.
- See Also:
BTPay_ErrorCode
powerOnICC
public int powerOnICC(byte m_Option,
ResDataStruct atrPPS)
- Power up the currently selected microprocessor card in the ICC reader.
It follows the ISO7816-3 power up sequence and returns the ATR as its response.
- Parameters:
m_Option
- the m_Option is optional but m_Option must be present if m_PPS is used.
the m_Option is defined as follows.
1. Bit0:0 = No IFS, 1 = Send S(IFS) request if T=1 protocol;
2. Bit1:0 = No Explicit PPS, 1 = Explicit PPS;
3. Bit2~5: Unused;
4. Bit6:0 = Auto PPS, 1 = No auto PPS for negotiate mode;
5. Bit7:0 = IFS response check, 1 = No check on response of s(IFS) request.
atrPPS
- the class for data.
For input parameter,m_PPS_ATR is to set the Protocol and Parameters Selection between card and reader,
only Di <= 4 are supported.
m_PPS_ATR must follow the structure specified in ISO7816-3 as PPS0,
[PPS1],[PPS2], and [PPS3].
For more information,please see ISO7816-3 section 7.2.
For output parameter,m_PPS_ATR holds ATR string.
the ATR string is following:
1. 2D01: Card Not Supported;
2. 2D03: Card Not Supported, wants CRC;
3. 690D: Command not supported on reader without ICC support;
4. 8100: ICC error time out on power-up;
5. 8200: invalid TS character received;
6. 8500: PPS confirmation error;
7. 8600: Unsupported F, D, or combination of F and D;
8. 8700: protocol not supported EMV TD1 out of range;
9. 8800: power not at proper level;
10. 8900: ATR length too long;
11. 8B01: EMV invalid TA1 byte value*;
12. 8B02: EMV TB1 required*;
13. 8B03: EMV Unsupported TB1 only 00 allowed*;
14. 8B04: EMV Card Error, invalid BWI or CWI*;
15. 8B06: EMV TB2 not allowed in ATR*;
16. 8B07: EMV TC2 out of range*;
17. 8B08: EMV TC2 out of range*;
18. 8B09: per EMV96 TA3 must be > 0xF*;
20. 8B10: ICC error on power-up;
21. 8B11: EMV T=1 then TB3 required*;
22. 8B12: Card Error, invalid BWI or CWI;
23. 8B13: Card Error, invalid BWI or CWI;
24. 8B17: EMV TC1/TB3 conflict*;
25. 8B20: EMV TD2 out of range must be T=1*;
26. 8C00: TCK error;
27. A304: connector has no voltage setting;
28. A305: ICC error on power-up invalid (SBLK(IFSD) exchange;
29. E301: ICC error after session start
- Returns:
- success or error code.
- See Also:
BTPay_ErrorCode
powerOffICC
public int powerOffICC()
- Power down the currently selected microprocessor card in the ICC reader.
- Returns:
- success or error code.
- See Also:
BTPay_ErrorCode
exchangeAPDU
public int exchangeAPDU(ResDataStruct exAPDU)
- Exchange APDU between the currently selected microprocessor card in the ICC reader.
The max length of APDU is 512 bytes.
- Parameters:
exAPDU
- the class for data.
For input parameter,the buffer for new APDU.
For output parameter, the buffer for old APDU.
- Returns:
- success or error code.
- See Also:
BTPay_ErrorCode