amlib.ccid

## Class ReaderAT88SC1608

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

-     public class ReaderAT88SC1608
      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
    `ReaderAT88SC1608(HardwareInterface Dev)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `AT88SC1608Cmd_InitializeAuthentication(byte[] pbHostRand)` AT88SC1608Cmd_InitializeAuthentication sends INITIALIZE AUTHENTICATION command to the card.
    `int` | `AT88SC1608Cmd_ReadConfigurationZone(byte bAddress, byte bReadLen, byte[] pReadBuffer, int[] pIntReturnLen)` AT88SC1608Cmd_ReadConfigurationZone reads data from the configuration zone of the card.
    `int` | `AT88SC1608Cmd_ReadUserZone(byte bAddress, byte bReadLen, byte[] pReadBuffer, int[] pIntReturnLen)` AT88SC1608Cmd_ReadUserZone reads data from the current user zone of the card
    `int` | `AT88SC1608Cmd_SetUserZoneAddress(byte bAddress)` AT88SC1608Cmd_SetUserZoneAddress selects the current user zone number.
    `int` | `AT88SC1608Cmd_VerifyAuthentication(byte[] pbHostChallenge)` AT88SC1608Cmd_VerifyAuthentication sends VERIFY AUTHENTICATION command to the card
    `int` | `AT88SC1608Cmd_VerifyPassword(byte bZoneNo, boolean bIsReadAccess, byte bPW1, byte bPW2, byte bPW3)` AT88SC1608Cmd_VerifyPassword verifies the read/write password of the selected zone.
    `int` | `AT88SC1608Cmd_WriteConfigurationZone(byte bAddress, byte bWriteLen, byte[] pWriteBuffer)` AT88SC1608Cmd_WriteConfigurationZone writes data to the configuration zone of the card.
    `int` | `AT88SC1608Cmd_WriteUserZone(byte bAddress, byte bWriteLen, byte[] pWriteBuffer)` AT88SC1608Cmd_WriteUserZone writes data to the current user zone of the card..
    `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

    - #### ReaderAT88SC1608

          public ReaderAT88SC1608(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

    - #### AT88SC1608Cmd_WriteUserZone

          public int AT88SC1608Cmd_WriteUserZone(byte bAddress,
                                                 byte bWriteLen,
                                                 byte[] pWriteBuffer)

      AT88SC1608Cmd_WriteUserZone writes data to the current user zone of the card..
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC1608Cmd_ReadUserZone

          public int AT88SC1608Cmd_ReadUserZone(byte bAddress,
                                                byte bReadLen,
                                                byte[] pReadBuffer,
                                                int[] pIntReturnLen)

      AT88SC1608Cmd_ReadUserZone reads data from the current user zone of the card
      Parameters:
        `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.
      Returns:
        zero for success

    - #### AT88SC1608Cmd_WriteConfigurationZone

          public int AT88SC1608Cmd_WriteConfigurationZone(byte bAddress,
                                                          byte bWriteLen,
                                                          byte[] pWriteBuffer)

      AT88SC1608Cmd_WriteConfigurationZone writes data to the configuration zone of the card.
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC1608Cmd_ReadConfigurationZone

          public int AT88SC1608Cmd_ReadConfigurationZone(byte bAddress,
                                                         byte bReadLen,
                                                         byte[] pReadBuffer,
                                                         int[] pIntReturnLen)

      AT88SC1608Cmd_ReadConfigurationZone reads data from the configuration zone of the card.
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC1608Cmd_SetUserZoneAddress

          public int AT88SC1608Cmd_SetUserZoneAddress(byte bAddress)

      AT88SC1608Cmd_SetUserZoneAddress selects the current user zone number.
      Parameters:
        `bAddress` - The user zone number to be selected. This value is between 0 to 7. Other value will be rejected.
      Returns:
        zero for success.

    - #### AT88SC1608Cmd_VerifyPassword

          public int AT88SC1608Cmd_VerifyPassword(byte bZoneNo,
                                                  boolean bIsReadAccess,
                                                  byte bPW1,
                                                  byte bPW2,
                                                  byte bPW3)

      AT88SC1608Cmd_VerifyPassword verifies the read/write password of the selected zone.
      Parameters:
        `bZoneNo` - The zone number.
        `bIsReadAccess` - TRUE for read password. FALSE for write password.
        `bPW1` - Password 1.
        `bPW2` - Password 2.
        `bPW3` - Password 3.
      Returns:
        zero for success.

    - #### AT88SC1608Cmd_InitializeAuthentication

          public int AT88SC1608Cmd_InitializeAuthentication(byte[] pbHostRand)

      AT88SC1608Cmd_InitializeAuthentication 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.

    - #### AT88SC1608Cmd_VerifyAuthentication

          public int AT88SC1608Cmd_VerifyAuthentication(byte[] pbHostChallenge)

      AT88SC1608Cmd_VerifyAuthentication 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.