amlib.ccid

## Class ReaderAT88SC153

- java.lang.Object
- - amlib.ccid.Reader
  - - amlib.ccid.ReaderAT88SC153

-     public class ReaderAT88SC153
      extends Reader

- - ### Field Summary

    - ### Fields inherited from class amlib.ccid.Reader

      `CardModeASYNC, CardModeAT45D041, CardModeAT88SC102, CardModeAT88SC153, CardModeAT88SC1608, CardModeI2C, CardModeINPHONE, CardModeSLE4428, CardModeSLE4442, CardModeSLE6636, CCID_POWEROFF, CCID_POWERON, CCID_PROTOCOL_NA, CCID_PROTOCOL_T0, CCID_PROTOCOL_T1, SLOT_STATUS_CARD_ABSENT, SLOT_STATUS_CARD_ACTIVE, SLOT_STATUS_CARD_INACTIVE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReaderAT88SC153(HardwareInterface Dev)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `AT88SC153Cmd_Addr(byte bOPcode, byte bAddress, byte bWriteLen, byte[] pWriteData, byte bReadLen, byte[] pReadData, int[] pIntReturnLen)` Base function for AT88SC153 operating EEPROM.
    `int` | `AT88SC153Cmd_ChangeChipSelectMask(byte bCSMask)` Change chip select mask for programed chip.
    `int` | `AT88SC153Cmd_InitializeAuthentication(byte[] pbHostRand)` Sends INITIALIZE AUTHENTICATION command to the card.
    `int` | `AT88SC153Cmd_ReadEeprom(byte bZone, byte bAddress, byte bReadLen, byte[] pReadBuffer, int[] pReturnLen)`
    `int` | `AT88SC153Cmd_ReadFuse(byte[] bFuseStatus)` Receive cureent fuse statud.
    `int` | `AT88SC153Cmd_VerifyAuthentication(byte[] pbHostChallenge)` Sends VERIFY AUTHENTICATION command to the card
    `int` | `AT88SC153Cmd_VerifyPassword(byte bPasswordIndex, boolean bIsReadAccess, byte bPW1, byte bPW2, byte bPW3)` Verifies the read/write password of the selected zone.
    `int` | `AT88SC153Cmd_WriteEeprom(byte bZone, byte bAddress, byte bWriteLen, byte[] pWriteBuffer)`
    `int` | `AT88SC153Cmd_WriteFuse(byte bFuseMask)` Do fuse operation.
    `int` | `open()` To open the reader.
    `int` | `open(int slot)` To open reader with given slot

    - ### Methods inherited from class amlib.ccid.Reader

      `close, escape, getAtr, getAtrString, getCardStatus, getCmdFailCode, getCurrentDev, getProtocol, getSN, setPower, setSlot, switchMode, transmit`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReaderAT88SC153

          public ReaderAT88SC153(HardwareInterface Dev)
                          throws ReaderException

      Constructor
      Parameters:
        `Dev` - HardwareInterface object which has been initialed
      Throws:
        `ReaderException`
      See Also:
        `ReaderException`

  - ### Method Detail

    - #### open

          public int open(int slot)

      Description copied from class: `Reader`
      To open reader with given slot
      Overrides:
        `open` in class `Reader`
      Parameters:
        `slot` - slot number to open
      Returns:
        READER_SUCCESSFUL or other error code

    - #### open

          public int open()

      Description copied from class: `Reader`
      To open the reader.
      Overrides:
        `open` in class `Reader`
      Returns:
        READER_SUCCESSFUL or other error code

    - #### AT88SC153Cmd_Addr

          public int AT88SC153Cmd_Addr(byte bOPcode,
                                       byte bAddress,
                                       byte bWriteLen,
                                       byte[] pWriteData,
                                       byte bReadLen,
                                       byte[] pReadData,
                                       int[] pIntReturnLen)

      Base function for AT88SC153 operating EEPROM.
      Parameters:
        `bOPcode` - Command of AT88SC153.
        `bAddress` - The memory address in the buffer or memory.
        `bWriteLen` - Number of bytes to be written to the card.
        `pWriteData` - Pointer to the buffer containing the data to be written to the card.
        `bReadLen` - 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.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_ChangeChipSelectMask

          public int AT88SC153Cmd_ChangeChipSelectMask(byte bCSMask)

      Change chip select mask for programed chip.
      Parameters:
        `bCSMask` - Default mask is 0xB0.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_WriteEeprom

          public int AT88SC153Cmd_WriteEeprom(byte bZone,
                                              byte bAddress,
                                              byte bWriteLen,
                                              byte[] pWriteBuffer)

      Parameters:
        `bZone` - Zone index. index = 0~3
        `bAddress` - Address in zone index to write data.
        `bWriteLen` - Number of bytes to be written to the card.
        `pWriteBuffer` - Pointer to the buffer containing the data to be written to the card.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_ReadEeprom

          public int AT88SC153Cmd_ReadEeprom(byte bZone,
                                             byte bAddress,
                                             byte bReadLen,
                                             byte[] pReadBuffer,
                                             int[] pReturnLen)

      Parameters:
        `bZone` - Zone index. index = 0~3
        `bAddress` - Address in zone index to read data.
        `bReadLen` - Number of bytes to be read from the card.
        `pReadBuffer` - Pointer to a buffer that receives the data read from the card.
        `pReturnLen` - Number of bytes which is actually received data from the card.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_VerifyPassword

          public int AT88SC153Cmd_VerifyPassword(byte bPasswordIndex,
                                                 boolean bIsReadAccess,
                                                 byte bPW1,
                                                 byte bPW2,
                                                 byte bPW3)

      Verifies the read/write password of the selected zone.
      Parameters:
        `bPasswordIndex` - password index. 0 or 1.
        `bIsReadAccess` - TRUE for read password. FALSE for write password.
        `bPW1` - Password 1.
        `bPW2` - Password 2.
        `bPW3` - Password 3.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_InitializeAuthentication

          public int AT88SC153Cmd_InitializeAuthentication(byte[] pbHostRand)

      Sends INITIALIZE AUTHENTICATION command to the card.
      Parameters:
        `pbHostRand` - Pointer to the buffer containing the 8 bytes data of host random numbers.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_VerifyAuthentication

          public int AT88SC153Cmd_VerifyAuthentication(byte[] pbHostChallenge)

      Sends VERIFY AUTHENTICATION command to the card
      Parameters:
        `pbHostChallenge` - Pointer to the buffer containing the 8 bytes data of host challenge.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_WriteFuse

          public int AT88SC153Cmd_WriteFuse(byte bFuseMask)

      Do fuse operation.
      Parameters:
        `bFuseMask` - Fuse mask.
      Returns:
        zero for success.

    - #### AT88SC153Cmd_ReadFuse

          public int AT88SC153Cmd_ReadFuse(byte[] bFuseStatus)

      Receive cureent fuse statud.
      Parameters:
        `bFuseStatus` - Fuse mask.
      Returns:
        zero for success.