amlib.ccid

## Class Reader4428

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

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `open()` To open the reader.
    `int` | `SLE4428Cmd_Read8Bits(int address, int intReadLen, byte[] pReadData, int[] pIntReturnLen)` SLE4428Cmd_Read8Bits read one byte of data without protect bit from the card.
    `int` | `SLE4428Cmd_Read9Bits(int address, int intReadLen, byte[] pReadData, byte[] pReadPB, int[] pIntReturnLen)` SLE4428Cmd_Read9Bits reads data with protect bits from the card.
    `int` | `SLE4428Cmd_Verify1stPSC(byte data)` SLE4428Cmd_Verify1stPSC is used to verify the 1st PSC byte.
    `int` | `SLE4428Cmd_Verify2ndPSC(byte data)` SLE4428Cmd_Verify2ndPSC is used to verify the 2nd PSC byte.
    `int` | `SLE4428Cmd_VerifyPSCAndEraseErrorCounter(byte b1stPsc, byte b2ndPsc, int[] pIntErrorReason)` SLE4428Cmd_VerifyPSCAndEraseErrorCounter is used to verify the 1st 2nd PSC bytes and erase error counter if the verification is OK.
    `int` | `SLE4428Cmd_WriteEraseWithoutPB(int address, byte data)` SLE4428Cmd_WriteEraseWithoutPB writes one byte data without protect bit to the card.
    `int` | `SLE4428Cmd_WriteEraseWithPB(int address, byte data)` SLE4428Cmd_WriteEraseWithPB writes one byte data with protect bit to the card.
    `int` | `SLE4428Cmd_WriteErrorCounter(byte data)` SLE4428Cmd_WriteErrorCounter writes error counter to the card.
    `int` | `SLE4428Cmd_WritePBWithDataComparison(int address, byte data)` SLE4428Cmd_WritePBWithDataComparison writes protect bit with data comparison.

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

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

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

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

- - ### Constructor Detail

    - #### Reader4428

          public Reader4428(HardwareInterface Dev)
                     throws ReaderException

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

  - ### Method Detail

    - #### 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

    - #### SLE4428Cmd_WriteEraseWithPB

          public int SLE4428Cmd_WriteEraseWithPB(int address,
                                                 byte data)

      SLE4428Cmd_WriteEraseWithPB writes one byte data with protect bit to the card.
      Parameters:
        `address` - The memory address to write to the card.
        `data` - The written data.
      Returns:
        zero for success.

    - #### SLE4428Cmd_WriteEraseWithoutPB

          public int SLE4428Cmd_WriteEraseWithoutPB(int address,
                                                    byte data)

      SLE4428Cmd_WriteEraseWithoutPB writes one byte data without protect bit to the card.
      Parameters:
        `address` - The memory address to write to the card.
        `data` - The written data.
      Returns:
        zero for success.

    - #### SLE4428Cmd_WritePBWithDataComparison

          public int SLE4428Cmd_WritePBWithDataComparison(int address,
                                                          byte data)

      SLE4428Cmd_WritePBWithDataComparison writes protect bit with data comparison. If the data is the same as the one in the card, the protect bit is written.
      Parameters:
        `address` - The memory address to write to the card.
        `data` - The written data.
      Returns:
        zero for success.

    - #### SLE4428Cmd_Read9Bits

          public int SLE4428Cmd_Read9Bits(int address,
                                          int intReadLen,
                                          byte[] pReadData,
                                          byte[] pReadPB,
                                          int[] pIntReturnLen)

      SLE4428Cmd_Read9Bits reads data with protect bits from the card.
      Parameters:
        `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
      Returns:
        0 for success.

    - #### SLE4428Cmd_Read8Bits

          public int SLE4428Cmd_Read8Bits(int address,
                                          int intReadLen,
                                          byte[] pReadData,
                                          int[] pIntReturnLen)

      SLE4428Cmd_Read8Bits read one byte of data without protect bit from the card.
      Parameters:
        `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.
      Returns:
        0 for success.

    - #### SLE4428Cmd_VerifyPSCAndEraseErrorCounter

          public int SLE4428Cmd_VerifyPSCAndEraseErrorCounter(byte b1stPsc,
                                                              byte b2ndPsc,
                                                              int[] pIntErrorReason)

      SLE4428Cmd_VerifyPSCAndEraseErrorCounter is used to verify the 1st 2nd PSC bytes and erase error counter if the verification is OK. Only apply to SLE4428.
      Parameters:
        `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.
      Returns:
        zero for success

    - #### SLE4428Cmd_WriteErrorCounter

          public int SLE4428Cmd_WriteErrorCounter(byte data)

      SLE4428Cmd_WriteErrorCounter writes error counter to the card.
      Parameters:
        `data` - The error counter. It is in bitmap format. Each bit presents one available attempt. Therefore, there are max 8 attempts.
      Returns:
        zero for success.

    - #### SLE4428Cmd_Verify1stPSC

          public int SLE4428Cmd_Verify1stPSC(byte data)

      SLE4428Cmd_Verify1stPSC is used to verify the 1st PSC byte.
      Parameters:
        `data` - The 1st PSC byte to be verified. attempt. Therefore, there are max 8 attempts.
      Returns:
        zero for success.

    - #### SLE4428Cmd_Verify2ndPSC

          public int SLE4428Cmd_Verify2ndPSC(byte data)

      SLE4428Cmd_Verify2ndPSC is used to verify the 2nd PSC byte.
      Parameters:
        `data` - The 2nd PSC byte to be verified. attempt. Therefore, there are max 8 attempts.
      Returns:
        zero for success.