|
SmartPos SDK for Android
1.3.7
|
Class of SmartCardManager (SmartCard Reader) implement. More...
Public Member Functions | |
| int | init (Context ctx) throws SmartPosException |
| Initialize smartcard reader. More... | |
| int | init (Context ctx, int mode) throws SmartPosException |
| void | deinit () |
| Deinitialize smartcard reader. More... | |
| void | selectSlot (int slot) throws SmartPosException |
| select the slot More... | |
| void | powerOn () throws SmartPosException |
| Sets card power on. More... | |
| void | powerOff () throws SmartPosException |
| Sets card power off. More... | |
| byte[] | getATR () throws SmartPosException |
| Gets the ATR in hex. More... | |
| int | getProtocol () throws SmartPosException |
| Gets the protocol(T0,T1) More... | |
| byte[] | getSN () throws SmartPosException |
| Gets the serial number. More... | |
| byte[] | sendAPDU (byte[] apdu) throws SmartPosException |
| Sends APDU. More... | |
| void | sendAPDU (byte[] apdu, byte[] respone, int[] responeLen) throws SmartPosException |
| Sends APDU for long respond data, CLA+INS+P1+P2+Lc+cmd+Le. More... | |
| int | AT24CSeriesCmdRead (int intStartAddr, byte bCardType, int intReadLen, byte[] pReadData, int[] pIntReturnLen) |
| read data from the memory card. More... | |
| int | AT24CSeriesCmdWrite (int intStartAddr, byte bCardType, int intWordPageSize, int intWriteLen, byte[] pWriteData) |
| writes data to the memory card. More... | |
| int | AT24CxxCmdRead (byte bDeviceAddress, int intStartAddr, int intReadLen, byte[] pReadData, int[] pIntReturnLen) |
| read data from the memory card. More... | |
| int | AT24CxxCmdWrite (int intStartAddr, int intWordPageSize, int intWriteLen, byte[] pWriteData) |
| writes data to the memory card. More... | |
| int | AT45D041Cmd (byte OPcode, int PageNo, int intStartAddr, int intWriteLen, byte[] pWriteData, int intReadLen, byte[] pReadData, int[] pIntReturnLen) |
| reads/write data from/to the card. More... | |
| int | AT88SC1608CmdInitializeAuthentication (byte[] pbHostRand) |
| sends INITIALIZE AUTHENTICATION command to the card. More... | |
| int | AT88SC1608CmdReadConfigurationZone (byte bAddress, byte bReadLen, byte[] pReadBuffer, int[] pIntReturnLen) |
| reads data from the configuration zone of the card. More... | |
| int | AT88SC1608CmdReadUserZone (byte bAddress, byte bReadLen, byte[] pReadBuffer, int[] pIntReturnLen) |
| reads data from the current user zone of the card More... | |
| int | AT88SC1608CmdSetUserZoneAddress (byte bAddress) |
| selects the current user zone number. More... | |
| int | AT88SC1608CmdVerifyAuthentication (byte[] pbHostChallenge) |
| sends INITIALIZE AUTHENTICATION command to the card. More... | |
| int | AT88SC1608CmdVerifyPassword (byte bZoneNo, boolean bIsReadAccess, byte bPW1, byte bPW2, byte bPW3) |
| verifies the read/write password of the selected zone. More... | |
| int | AT88SC1608CmdWriteConfigurationZone (byte bAddress, byte bWriteLen, byte[] pWriteBuffer) |
| writes data to the configuration zone of the card. More... | |
| int | AT88SC1608CmdWriteUserZone (byte bAddress, byte bWriteLen, byte[] pWriteBuffer) |
| writes data to the current user zone of the card. More... | |
| int | AT88SC102CmdOpBitGetAddr (int[] pIntCurBitAddr) |
| gets the current bit address of the card. The smartcard reader self-maintains the current address. The function returns the internal variables of the reader which indicated the current bit address. More... | |
| int | AT88SC102CmdOpBitsGotoAddr (int intTargetAddr) |
| makes the card JUMP to the target bit address. provides an easy way to JUMP to any absolute address, no matter forward or backward. does not use RESET operation to reset the address counter, so all the internal flags of the card is not affected after using this function. The smartcard reader self-maintains the address internally, so the caller could safely call this function. More... | |
| int | AT88SC102CmdOpBitsIncAddr (int intBitsIncAddr) |
| increases the internal address counter of the card. The unit of the increment is in bit based. Addressing of the AT88SC102 is sequential. Specific bit addresses may be reached by completing a reset, then clocking the device (INC/READ) until the desired address is reached. The AT88SC102 will determine which operations are allowed at specific address locations. These operations are specified in Tables 1 and 2. For instance, to address the issuer zone (IZ), execute a reset operation, then clock the device 16 times. The device now outputs the first bit of the IZ. After the address counter counts up to 1567, the next CLK pulse resets the address to “0. More... | |
| int | AT88SC102CmdOpBitsRead (int intReadLen, byte[] pDataBuffer) |
| reads bit data from the card from current address. More... | |
| int | AT88SC102CmdOpBytesComp (int intCompLen, byte[] pDataBuffer) |
| sends data to the card for comparison. More... | |
| int | AT88SC102CmdOpBytesIncAddr (int intBytesIncAddr) |
| increases the internal address counter of the card. The unit of the increment is in byte based More... | |
| int | AT88SC102CmdOpBytesRead (int intReadLen, byte[] pDataBuffer) |
| reads bytes data from the card from current address. More... | |
| int | AT88SC102CmdOpBytesWrite (int intWriteLen, byte[] pDataBuffer) |
| writes data to current address of the card. More... | |
| int | AT88SC102CmdOpReset () |
| sends micro operation, RESET, to the card. This operation will reset the internal address to “0”. After the falling edge of RST, the first bit of the fabrication zone (Address 0) will be driven on the I/O contact. The erase flags (E1 and E2) will be reset. More... | |
| int | AT88SC102CmdOpSingleBitErase () |
| sends a erase operation with single bit to logic 1. The address is not changed after calling this function. More... | |
| int | AT88SC102CmdOpSingleBitWrite () |
| sends a write operation with single bit to logic 0. The address is not changed after calling this function. More... | |
| int | AT88SC102CmdOpStandby () |
| sends micro operation, STANDBY, to the card. The device is placed in standby mode when FUS pin = “0” and RST = “1”. The address will not increment when RST is high. More... | |
| int | AT88SC102CmdSetFusPinHigh () |
| drives the FUS pin of the card to high state. Used for personalizing the device. FUS must be high to be able to personalize the device when the issuer fuse is unblown. In Security Level 1, the FUS pin may be forced low to simulate Security Level 2. In Security Level 2, the FUS pin has no function. More... | |
| int | AT88SC102CmdSetFusPinLow () |
| drives the FUS pin of the card to low state. Used for personalizing the device. FUS must be high to be able to personalize the device when the issuer fuse is unblown. In Security Level 1, the FUS pin may be forced low to simulate Security Level 2. In Security Level 2, the FUS pin has no function. More... | |
| int | AT88SC102CmdSetRstPinHigh () |
| drives the RST pin of the card to high state. makes the reader drives RST pin to low. If the previously state of RST pin is high, then the bit address will reset to 0. If the previously state of RST pin is low, then the bit address keep unchanged. The bit address is also auto maintained by the reader internally. More... | |
| int | AT88SC102CmdSetRstPinLow () |
| drives the RST pin of the card to high state. makes the reader drives RST pin to low. If the previously state of RST pin is high, then the bit address will reset to 0. If the previously state of RST pin is low, then the bit address keep unchanged. The bit address is also auto maintained by the reader internally. More... | |
| int | SLE4428CmdRead8Bits (int address, int intReadLen, byte[] pReadData, int[] pIntReturnLen) |
| read one byte of data without protect bit from the card. More... | |
| int | SLE4428CmdRead9Bits (int address, int intReadLen, byte[] pReadData, byte[] pReadPB, int[] pIntReturnLen) |
| reads data with protect bits from the card. More... | |
| int | SLE4428CmdVerify1stPSC (byte data) |
| used to verify the 1st PSC byte. More... | |
| int | SLE4428CmdVerify2ndPSC (byte data) |
| used to verify the 2nd PSC byte. More... | |
| int | SLE4428CmdVerifyPSCAndEraseErrorCounter (byte b1stPsc, byte b2ndPsc, int[] pIntErrorReason) |
| used to verify the 1st 2nd PSC bytes and erase error counter if the verification is OK. Only apply to SLE4428. More... | |
| int | SLE4428CmdWriteEraseWithoutPB (int address, byte data) |
| writes one byte data without protect bit to the card. More... | |
| int | SLE4428CmdWriteEraseWithPB (int address, byte data) |
| writes one byte data with protect bit to the card. More... | |
| int | SLE4428CmdWriteErrorCounter (byte data) |
| writes error counter to the card. More... | |
| int | SLE4428CmdWritePBWithDataComparison (int address, byte data) |
| writes protect bit with data comparison. If the data is the same as the one in the card, the protect bit is written. More... | |
| int | SLE4442CmdCompareVerificationData (byte bAddress, byte bData) |
| compares the data with the specified reference byte in the security memory. More... | |
| int | SLE4442CmdReadMainMemory (byte bAddress, byte bReadLen, byte[] pReadData, int[] pReturnLen) |
| reads data from the main memory of the card. More... | |
| int | SLE4442CmdReadProtectionMemory (byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| reads data from the protection memory of the card. More... | |
| int | SLE4442CmdReadSecurityMemory (byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| reads data from the security memory of the card. More... | |
| int | SLE4442CmdUpdateMainMemory (byte bAddress, byte bData) |
| updates one byte data in the main memory of the card. More... | |
| int | SLE4442CmdUpdateSecurityMemory (byte bAddress, byte bData) |
| updates one byte data in the main memory of the card. More... | |
| int | SLE4442CmdVerify (int intPinLen, byte[] pPinData) |
| Verify the pin of the card. Only apply to SLE4442. More... | |
| int | SLE4442CmdWriteProtectionMemory (byte bAddress, byte bData) |
| write one byte data in the protection memory of the card. More... | |
| int | SLE6636CmdAuthentication (byte bKeyNo, byte bClock, byte bWriteLen, byte[] pWChallengeBuf, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| send authentication command More... | |
| int | SLE6636CmdReadCounters (byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| read Counter Area from the card. More... | |
| int | SLE6636CmdReadMemory (byte bAddress, byte bReadMEMLen, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| read Memory Area More... | |
| int | SLE6636CmdReload (byte bAddress, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| reload(Erase 8 Bits with Carry Operation) . More... | |
| int | SLE6636CmdVerification (byte bTC1, byte bTC2, byte bTC3, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| int | SLE6636CmdWriteCounter (byte bAddress, byte bWriteData, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| write Counter Area to the card. More... | |
| int | SLE6636CmdWriteMemory (int intApduLen, byte bAddress, byte bWriteLen, byte[] pWriteBuffer, byte bReadLen, byte[] pReadData, int[] pIntReturnLen) |
| write Memory Area More... | |
Static Public Member Functions | |
| static String | errCode2String (int errCode) |
| convert error code to string More... | |
Class of SmartCardManager (SmartCard Reader) implement.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT24CSeriesCmdRead | ( | int | intStartAddr, |
| byte | bCardType, | ||
| int | intReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
read data from the memory card.
| intStartAddr | The memory address to read from. |
| bCardType | The card type. |
| intReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT24CSeriesCmdWrite | ( | int | intStartAddr, |
| byte | bCardType, | ||
| int | intWordPageSize, | ||
| int | intWriteLen, | ||
| byte[] | pWriteData | ||
| ) |
writes data to the memory card.
| intStartAddr | The memory address to write to. |
| bCardType | The card type. |
| intWordPageSize | The page size for write operation. This value is depended on the property of the memory card. If the programmer doesn't know it, set it to 0x08. |
| intWriteLen | Number of bytes to be written to the card. |
| pWriteData | Pointer to the buffer containing the data to be written to the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT24CxxCmdRead | ( | byte | bDeviceAddress, |
| int | intStartAddr, | ||
| int | intReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
read data from the memory card.
| bDeviceAddress | The I2C Device Address. Should set to 0x50. |
| intStartAddr | The memory address to read from. Note:The single byte Card,lngStartAddr = 0x7FFF.The double byte Card,lngStartAddr |= 0x8000 |
| intReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT24CxxCmdWrite | ( | int | intStartAddr, |
| int | intWordPageSize, | ||
| int | intWriteLen, | ||
| byte[] | pWriteData | ||
| ) |
writes data to the memory card.
| intStartAddr | The memory address to write to. Note:The single byte Card,lngStartAddr = 0x7FFF.The double byte Card,lngStartAddr |= 0x8000 |
| intWordPageSize | The page size for write operation. This value is depended on the property of the memory card. If the programmer doesn't know it, set it to 0x08. |
| intWriteLen | Number of bytes to be written to the card. |
| pWriteData | Pointer to the buffer containing the data to be written to the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT45D041Cmd | ( | byte | OPcode, |
| int | PageNo, | ||
| int | intStartAddr, | ||
| int | intWriteLen, | ||
| byte[] | pWriteData, | ||
| int | intReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
reads/write data from/to the card.
| OPcode | The AT45D041 command code |
| PageNo | The page number to access. |
| intStartAddr | The memory address in the buffer or memory. |
| intWriteLen | Number of bytes to be written to the card. |
| pWriteData | Pointer to the buffer containing the data to be written to the card. |
| intReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Number of bytes which is actually received data from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBitGetAddr | ( | int[] | pIntCurBitAddr | ) |
gets the current bit address of the card. The smartcard reader self-maintains the current address. The function returns the internal variables of the reader which indicated the current bit address.
| pIntCurBitAddr | Pointer to the current bit address of the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBitsGotoAddr | ( | int | intTargetAddr | ) |
makes the card JUMP to the target bit address. provides an easy way to JUMP to any absolute address, no matter forward or backward. does not use RESET operation to reset the address counter, so all the internal flags of the card is not affected after using this function. The smartcard reader self-maintains the address internally, so the caller could safely call this function.
| intTargetAddr | The target bit address to be reached. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBitsIncAddr | ( | int | intBitsIncAddr | ) |
increases the internal address counter of the card. The unit of the increment is in bit based. Addressing of the AT88SC102 is sequential. Specific bit addresses may be reached by completing a reset, then clocking the device (INC/READ) until the desired address is reached. The AT88SC102 will determine which operations are allowed at specific address locations. These operations are specified in Tables 1 and 2. For instance, to address the issuer zone (IZ), execute a reset operation, then clock the device 16 times. The device now outputs the first bit of the IZ. After the address counter counts up to 1567, the next CLK pulse resets the address to “0.
| intBitsIncAddr | The numbers of bit address to be incremented. If the bit address reaches the boundary, 1568, then the card internally reset the bit address to 0. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBitsRead | ( | int | intReadLen, |
| byte[] | pDataBuffer | ||
| ) |
reads bit data from the card from current address.
| intReadLen | Number of bits to be read from the card. |
| pDataBuffer | Pointer to the buffer that receives the data read from the card. One byte only contains one bit data, so the buffer size should be intReadLen byte size |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBytesComp | ( | int | intCompLen, |
| byte[] | pDataBuffer | ||
| ) |
sends data to the card for comparison.
| intCompLen | Number of bytes to be compared in the card. |
| pDataBuffer | Pointer to the buffer that contains the data to be compared in the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBytesIncAddr | ( | int | intBytesIncAddr | ) |
increases the internal address counter of the card. The unit of the increment is in byte based
| intBytesIncAddr | The numbers of bytes address to be incremented. If the bit address reaches the boundary, 1568, then the card internally reset the bit address to 0. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBytesRead | ( | int | intReadLen, |
| byte[] | pDataBuffer | ||
| ) |
reads bytes data from the card from current address.
| intReadLen | Number of bytes to be read from the card. |
| pDataBuffer | Pointer to the buffer that receives the data read from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpBytesWrite | ( | int | intWriteLen, |
| byte[] | pDataBuffer | ||
| ) |
writes data to current address of the card.
| intWriteLen | Number of bytes to be written to the card. |
| pDataBuffer | Pointer to the buffer that contains the data to be written to the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpReset | ( | ) |
sends micro operation, RESET, to the card. This operation will reset the internal address to “0”. After the falling edge of RST, the first bit of the fabrication zone (Address 0) will be driven on the I/O contact. The erase flags (E1 and E2) will be reset.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpSingleBitErase | ( | ) |
sends a erase operation with single bit to logic 1. The address is not changed after calling this function.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpSingleBitWrite | ( | ) |
sends a write operation with single bit to logic 0. The address is not changed after calling this function.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdOpStandby | ( | ) |
sends micro operation, STANDBY, to the card. The device is placed in standby mode when FUS pin = “0” and RST = “1”. The address will not increment when RST is high.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdSetFusPinHigh | ( | ) |
drives the FUS pin of the card to high state. Used for personalizing the device. FUS must be high to be able to personalize the device when the issuer fuse is unblown. In Security Level 1, the FUS pin may be forced low to simulate Security Level 2. In Security Level 2, the FUS pin has no function.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdSetFusPinLow | ( | ) |
drives the FUS pin of the card to low state. Used for personalizing the device. FUS must be high to be able to personalize the device when the issuer fuse is unblown. In Security Level 1, the FUS pin may be forced low to simulate Security Level 2. In Security Level 2, the FUS pin has no function.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdSetRstPinHigh | ( | ) |
drives the RST pin of the card to high state. makes the reader drives RST pin to low. If the previously state of RST pin is high, then the bit address will reset to 0. If the previously state of RST pin is low, then the bit address keep unchanged. The bit address is also auto maintained by the reader internally.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC102CmdSetRstPinLow | ( | ) |
drives the RST pin of the card to high state. makes the reader drives RST pin to low. If the previously state of RST pin is high, then the bit address will reset to 0. If the previously state of RST pin is low, then the bit address keep unchanged. The bit address is also auto maintained by the reader internally.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdInitializeAuthentication | ( | byte[] | pbHostRand | ) |
sends INITIALIZE AUTHENTICATION command to the card.
| pbHostRand | Pointer to the buffer containing the 8 bytes data of host random numbers. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdReadConfigurationZone | ( | byte | bAddress, |
| byte | bReadLen, | ||
| byte[] | pReadBuffer, | ||
| int[] | pIntReturnLen | ||
| ) |
reads data from the configuration zone of the card.
| bAddress | The memory address in the configuration zone to read from. |
| bReadLen | Number of bytes to be read from the card. |
| pReadBuffer | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Number of bytes which is actually received data from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdReadUserZone | ( | byte | bAddress, |
| byte | bReadLen, | ||
| byte[] | pReadBuffer, | ||
| int[] | pIntReturnLen | ||
| ) |
reads data from the current user zone of the card
| bAddress | The memory address in the current user zone to read from. |
| bReadLen | Number of bytes to be read from the card. |
| pReadBuffer | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Number of bytes which is actually received data from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdSetUserZoneAddress | ( | byte | bAddress | ) |
selects the current user zone number.
| bAddress | The user zone number to be selected. This value is between 0 to 7. Other value will be rejected. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdVerifyAuthentication | ( | byte[] | pbHostChallenge | ) |
sends INITIALIZE AUTHENTICATION command to the card.
| pbHostChallenge | Pointer to the buffer containing the 8 bytes data of host random numbers. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdVerifyPassword | ( | byte | bZoneNo, |
| boolean | bIsReadAccess, | ||
| byte | bPW1, | ||
| byte | bPW2, | ||
| byte | bPW3 | ||
| ) |
verifies the read/write password of the selected zone.
| bZoneNo | The zone number. |
| bIsReadAccess | TRUE for read password. FALSE for write password. |
| bPW1 | Password 1. |
| bPW2 | Password 2. |
| bPW3 | Password 3. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdWriteConfigurationZone | ( | byte | bAddress, |
| byte | bWriteLen, | ||
| byte[] | pWriteBuffer | ||
| ) |
writes data to the configuration zone of the card.
| bAddress | The memory address in the current user zone to write to. |
| bWriteLen | Number of bytes to be written to the card. |
| pWriteBuffer | Pointer to the buffer containing the data to be written to the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.AT88SC1608CmdWriteUserZone | ( | byte | bAddress, |
| byte | bWriteLen, | ||
| byte[] | pWriteBuffer | ||
| ) |
writes data to the current user zone of the card.
| bAddress | The memory address in the current user zone to write to. |
| bWriteLen | Number of bytes to be written to the card. |
| pWriteBuffer | Pointer to the buffer containing the data to be written to the card. |
| void com.paydevice.smartpos.sdk.smartcard.SmartCardManager.deinit | ( | ) |
Deinitialize smartcard reader.
|
static |
convert error code to string
| errCode | error code |
| byte [] com.paydevice.smartpos.sdk.smartcard.SmartCardManager.getATR | ( | ) | throws SmartPosException |
Gets the ATR in hex.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.getProtocol | ( | ) | throws SmartPosException |
Gets the protocol(T0,T1)
| byte [] com.paydevice.smartpos.sdk.smartcard.SmartCardManager.getSN | ( | ) | throws SmartPosException |
Gets the serial number.
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.init | ( | Context | ctx | ) | throws SmartPosException |
Initialize smartcard reader.
| ctx | Android Context |
| void com.paydevice.smartpos.sdk.smartcard.SmartCardManager.powerOff | ( | ) | throws SmartPosException |
Sets card power off.
| void com.paydevice.smartpos.sdk.smartcard.SmartCardManager.powerOn | ( | ) | throws SmartPosException |
Sets card power on.
| void com.paydevice.smartpos.sdk.smartcard.SmartCardManager.selectSlot | ( | int | slot | ) | throws SmartPosException |
select the slot
| slot | 0,1 |
| byte [] com.paydevice.smartpos.sdk.smartcard.SmartCardManager.sendAPDU | ( | byte[] | apdu | ) | throws SmartPosException |
Sends APDU.
| apdu | apdu byte array |
| void com.paydevice.smartpos.sdk.smartcard.SmartCardManager.sendAPDU | ( | byte[] | apdu, |
| byte[] | respone, | ||
| int[] | responeLen | ||
| ) | throws SmartPosException |
Sends APDU for long respond data, CLA+INS+P1+P2+Lc+cmd+Le.
| apdu | apdu byte array |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdRead8Bits | ( | int | address, |
| int | intReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
read one byte of data without protect bit from the card.
| address | The memory address to read from the card. |
| intReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pIntReturnLen | Pointer to a number of bytes which is actually received data from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdRead9Bits | ( | int | address, |
| int | intReadLen, | ||
| byte[] | pReadData, | ||
| byte[] | pReadPB, | ||
| int[] | pIntReturnLen | ||
| ) |
reads data with protect bits from the card.
| address | The memory address to read from the card. |
| intReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pReadPB | Point to the buffer that receives the protect bits read from the card. Each protect bit occupies one byte space This buffer size is the same as pReadData. The values in the buffer are 0x00 or 0x01. |
| pIntReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdVerify1stPSC | ( | byte | data | ) |
used to verify the 1st PSC byte.
| data | The 1st PSC byte to be verified. attempt. Therefore, there are max 8 attempts. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdVerify2ndPSC | ( | byte | data | ) |
used to verify the 2nd PSC byte.
| data | The 2nd PSC byte to be verified. attempt. Therefore, there are max 8 attempts. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdVerifyPSCAndEraseErrorCounter | ( | byte | b1stPsc, |
| byte | b2ndPsc, | ||
| int[] | pIntErrorReason | ||
| ) |
used to verify the 1st 2nd PSC bytes and erase error counter if the verification is OK. Only apply to SLE4428.
| b1stPsc | The 1st PSC byte to be verified. |
| b2ndPsc | The 2nd PSC byte to be verified. |
| pIntErrorReason | Specify the error code if the function fails. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdWriteEraseWithoutPB | ( | int | address, |
| byte | data | ||
| ) |
writes one byte data without protect bit to the card.
| address | The memory address to write to the card. |
| data | The written data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdWriteEraseWithPB | ( | int | address, |
| byte | data | ||
| ) |
writes one byte data with protect bit to the card.
| address | The memory address to write to the card. |
| data | The written data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdWriteErrorCounter | ( | byte | data | ) |
writes error counter to the card.
| data | The error counter. It is in bitmap format. Each bit presents one available attempt. Therefore, there are max 8 attempts. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4428CmdWritePBWithDataComparison | ( | int | address, |
| byte | data | ||
| ) |
writes protect bit with data comparison. If the data is the same as the one in the card, the protect bit is written.
| address | The memory address to write to the card. |
| data | The written data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdCompareVerificationData | ( | byte | bAddress, |
| byte | bData | ||
| ) |
compares the data with the specified reference byte in the security memory.
| bAddress | The security memory address whose value is to be compared. bAddress is 1, 2, or 3. |
| bData | The compared data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdReadMainMemory | ( | byte | bAddress, |
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pReturnLen | ||
| ) |
reads data from the main memory of the card.
| bAddress | The memory address to read from. |
| bReadLen | Number of bytes to be read from the card. |
| pReadData | Pointer to a buffer that receives the data read from the card. |
| pReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdReadProtectionMemory | ( | byte | bReadLen, |
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
reads data from the protection memory of the card.
| bReadLen | Number of bytes to be read from the card. This byte should be set to 4. |
| pReadData | Pointer to a buffer that receives the data read from the protection memory of the card. |
| pIntReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdReadSecurityMemory | ( | byte | bReadLen, |
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
reads data from the security memory of the card.
| bReadLen | Number of bytes to be read from the card. This byte should be set to 4. |
| pReadData | Pointer to a buffer that receives the data read from the the security memory of the card. |
| pIntReturnLen | Pointer to the length, in bytes, of the pReadData parameter and receives the actual number of bytes received from the card. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdUpdateMainMemory | ( | byte | bAddress, |
| byte | bData | ||
| ) |
updates one byte data in the main memory of the card.
| bAddress | The main memory address to update |
| bData | The updated data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdUpdateSecurityMemory | ( | byte | bAddress, |
| byte | bData | ||
| ) |
updates one byte data in the main memory of the card.
| bAddress | The security memory address to update |
| bData | The updated data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdVerify | ( | int | intPinLen, |
| byte[] | pPinData | ||
| ) |
Verify the pin of the card. Only apply to SLE4442.
| intPinLen | The length of pin data. |
| pPinData | The data of pin buffer. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE4442CmdWriteProtectionMemory | ( | byte | bAddress, |
| byte | bData | ||
| ) |
write one byte data in the protection memory of the card.
| bAddress | The protection memory address to be written. |
| bData | The written data. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdAuthentication | ( | byte | bKeyNo, |
| byte | bClock, | ||
| byte | bWriteLen, | ||
| byte[] | pWChallengeBuf, | ||
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
send authentication command
| bKeyNo | Specifies the number of Key(0x01 or 0x02). |
| bClock | Specifies the clock. |
| bWriteLen | Specifies the data length of challenge data. |
| pWChallengeBuf | Pointer to the buffer that to be challenge. |
| bReadLen | Specifies the buffer length to read from the card. |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdReadCounters | ( | byte | bReadLen, |
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
read Counter Area from the card.
| bReadLen | Specifies the buffer length to read from the card. It should be set to 8. |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdReadMemory | ( | byte | bAddress, |
| byte | bReadMEMLen, | ||
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
read Memory Area
| bAddress | Specifies the address to read from memory area. |
| bReadMEMLen | Specifies the number of bytes to read from the memory. |
| bReadLen | Specifies the buffer length to be read from the card. |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdReload | ( | byte | bAddress, |
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
reload(Erase 8 Bits with Carry Operation) .
| bAddress | Specifies the address to reload. |
| bReadLen | Specifies the buffer length to read from the card |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdVerification | ( | byte | bTC1, |
| byte | bTC2, | ||
| byte | bTC3, | ||
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
| bTC1 | |
| bTC2 | |
| bTC3 | |
| bReadLen | Specifies the buffer length to read from the card . |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdWriteCounter | ( | byte | bAddress, |
| byte | bWriteData, | ||
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
write Counter Area to the card.
| bAddress | Specifies address to write to counter area. |
| bWriteData | Specifies the data to write to counter area. |
| bReadLen | Specifies the buffer length to read from the card. |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |
| int com.paydevice.smartpos.sdk.smartcard.SmartCardManager.SLE6636CmdWriteMemory | ( | int | intApduLen, |
| byte | bAddress, | ||
| byte | bWriteLen, | ||
| byte[] | pWriteBuffer, | ||
| byte | bReadLen, | ||
| byte[] | pReadData, | ||
| int[] | pIntReturnLen | ||
| ) |
write Memory Area
| intApduLen | Should set to 0. |
| bAddress | Specifies the address to write to memory area. |
| bWriteLen | Specifies the number of bytes to write to memory area. |
| pWriteBuffer | Pointer to the buffer containing the data to be written to the card. |
| bReadLen | Specifies the buffer length to be read from the card. |
| pReadData | Pointer to the buffer that receives the data. |
| pIntReturnLen | Pointer to the variable that receives the number of bytes read. |