amlib.ccid

## Class ReaderAT88SC102

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

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `AT88SC102Cmd_OpBitGetAddr(int[] pIntCurBitAddr)` This function gets the current bit address of the card.
    `int` | `AT88SC102Cmd_OpBitsGotoAddr(int intTargetAddr)` This function makes the card JUMP to the target bit address.
    `int` | `AT88SC102Cmd_OpBitsIncAddr(int intBitsIncAddr)` This function increases the internal address counter of the card.
    `int` | `AT88SC102Cmd_OpBitsRead(int intReadLen, byte[] pDataBuffer)` This function reads bit data from the card from current address.
    `int` | `AT88SC102Cmd_OpBytesComp(int intCompLen, byte[] pDataBuffer)` This function sends data to the card for comparison.
    `int` | `AT88SC102Cmd_OpBytesIncAddr(int intBytesIncAddr)` This function increases the internal address counter of the card.
    `int` | `AT88SC102Cmd_OpBytesRead(int intReadLen, byte[] pDataBuffer)` This function reads bytes data from the card from current address.
    `int` | `AT88SC102Cmd_OpBytesWrite(int intWriteLen, byte[] pDataBuffer)` This function writes data to current address of the card.
    `int` | `AT88SC102Cmd_OpReset()` This function sends micro operation, RESET, to the card.
    `int` | `AT88SC102Cmd_OpSingleBitErase()` This function sends a erase operation with single bit to logic 1.
    `int` | `AT88SC102Cmd_OpSingleBitWrite()` This function sends a write operation with single bit to logic 0.
    `int` | `AT88SC102Cmd_OpStandby()` This function sends micro operation, STANDBY, to the card.
    `int` | `AT88SC102Cmd_SetFusPinHigh()` This function drives the FUS pin of the card to high state.
    `int` | `AT88SC102Cmd_SetFusPinLow()` This function drives the FUS pin of the card to low state.
    `int` | `AT88SC102Cmd_SetRstPinHigh()` AT88SC102Cmd_SetRstPinHigh drives the RST pin of the card to high state.
    `int` | `AT88SC102Cmd_SetRstPinLow()` AT88SC102Cmd_SetRstPinLow drives the RST pin of the card to low state This function makes the reader drives RST pin to low.
    `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

    - #### ReaderAT88SC102

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

    - #### AT88SC102Cmd_OpReset

          public int AT88SC102Cmd_OpReset()

      This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpStandby

          public int AT88SC102Cmd_OpStandby()

      This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_SetFusPinLow

          public int AT88SC102Cmd_SetFusPinLow()

      This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_SetFusPinHigh

          public int AT88SC102Cmd_SetFusPinHigh()

      This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_SetRstPinLow

          public int AT88SC102Cmd_SetRstPinLow()

      AT88SC102Cmd_SetRstPinLow drives the RST pin of the card to low state This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_SetRstPinHigh

          public int AT88SC102Cmd_SetRstPinHigh()

      AT88SC102Cmd_SetRstPinHigh drives the RST pin of the card to high state. This function 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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBitsIncAddr

          public int AT88SC102Cmd_OpBitsIncAddr(int intBitsIncAddr)

      This function 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.
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBitsGotoAddr

          public int AT88SC102Cmd_OpBitsGotoAddr(int intTargetAddr)

      This function makes the card JUMP to the target bit address. This function provides an easy way to JUMP to any absolute address, no matter forward or backward. This function 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.
      Parameters:
        `intTargetAddr` - The target bit address to be reached.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBitGetAddr

          public int AT88SC102Cmd_OpBitGetAddr(int[] pIntCurBitAddr)

      This function 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.
      Parameters:
        `pIntCurBitAddr` - Pointer to the current bit address of the card.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBitsRead

          public int AT88SC102Cmd_OpBitsRead(int intReadLen,
                                             byte[] pDataBuffer)

      This function reads bit data from the card from current address.
      Parameters:
        `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
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpSingleBitWrite

          public int AT88SC102Cmd_OpSingleBitWrite()

      This function sends a write operation with single bit to logic 0. The address is not changed after calling this function.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpSingleBitErase

          public int AT88SC102Cmd_OpSingleBitErase()

      This function sends a erase operation with single bit to logic 1. The address is not changed after calling this function.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBytesIncAddr

          public int AT88SC102Cmd_OpBytesIncAddr(int intBytesIncAddr)

      This function increases the internal address counter of the card. The unit of the increment is in byte based
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBytesRead

          public int AT88SC102Cmd_OpBytesRead(int intReadLen,
                                              byte[] pDataBuffer)

      This function reads bytes data from the card from current address.
      Parameters:
        `intReadLen` - Number of bytes to be read from the card.
        `pDataBuffer` - Pointer to the buffer that receives the data read from the card.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBytesWrite

          public int AT88SC102Cmd_OpBytesWrite(int intWriteLen,
                                               byte[] pDataBuffer)

      This function writes data to current address of the card.
      Parameters:
        `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.
      Returns:
        zero for success.

    - #### AT88SC102Cmd_OpBytesComp

          public int AT88SC102Cmd_OpBytesComp(int intCompLen,
                                              byte[] pDataBuffer)

      This function sends data to the card for comparison.
      Parameters:
        `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.
      Returns:
        zero for success.