com.gary.rfid.proto

## Class RFIDPacket

- java.lang.Object
- - com.gary.rfid.proto.RFIDPacket

-     public class RFIDPacket
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `CARD_MODE`
    `static int` | `CRC_ERR`
    `static int` | `FORMART_ERR`
    `static int` | `GET_HIDSTRUCT_ERR`
    `static int` | `HID_TIMEOUT`
    `static int` | `HIDINIT_ERR`
    `static int` | `MODE_ERR`
    `USBOp` | `mUSBOp`
    `static int[]` | `PACKET`
    `static int` | `PARAMETER_ERR`
    `static int` | `READ_ERR`
    `static int` | `RFID_INDEX`
    `static byte` | `RFID_REPORT_ID`
    `static byte` | `RFID_STX_ZY`
    `static byte` | `RFID_STX_ZY1`
    `static byte` | `STX_ZY_RE`
    `static int` | `WRITE_ERR`
    `static int` | `ZY_ERR1`
    `static int` | `ZY_ERR10`
    `static int` | `ZY_ERR11`
    `static int` | `ZY_ERR12`
    `static int` | `ZY_ERR2`
    `static int` | `ZY_ERR3`
    `static int` | `ZY_ERR4`
    `static int` | `ZY_ERR5`
    `static int` | `ZY_ERR6`
    `static int` | `ZY_ERR7`
    `static int` | `ZY_ERR8`
    `static int` | `ZY_ERR9`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RFIDPacket(UsbManager manager, Context context, java.lang.String AppName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `buildPackge(int[] configData, int dataLen)`
    `boolean` | `PS_RF_BackUpValue(int inSrcSector, int inTarSector, int inKeyMod, int[] inKeyData, int inKeyDataLen)` Functional description: Backup wallet
    `int` | `PS_RF_CardSleep()` Functional description: S50 card goes to sleep state
    `boolean` | `PS_RF_DecValue(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen, long inValueData)` Functional description: S50 card Deduction amount
    `boolean` | `PS_RF_IncValue(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen, long inValueData)` Functional description: S50 card value added
    `int` | `PS_RF_Read(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen, int[] cardNoData)` Functional description: Reading S50 CARD
    `long` | `PS_RF_ReadValue(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen)` Functional description: S50 card inquiry balance
    `int` | `PS_RF_Reset()` Functional description: The reader resets and puts the reader into a low power state
    `int` | `PS_RF_Search(int[] cardNoData)` Functional description: Search card
    `int` | `PS_RF_Set(int inMode)` Functional description: RFID RF switch
    `boolean` | `PS_RF_Write(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen, int[] inData, int inDataLen)` Functional description: Writing S50 CARD
    `boolean` | `PS_RF_WriteValue(int inSector, int inKeyMod, int[] inKeyData, int inKeyDataLen, long inValueData)` Functional description: S50 card initialization wallet
    `static int` | `resolveConfigData(int[] configData)`

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

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

- - ### Field Detail

    - #### RFID_INDEX

          public static int RFID_INDEX

    - #### PACKET

          public static int[] PACKET

    - #### CARD_MODE

          public static boolean CARD_MODE

    - #### RFID_REPORT_ID

          public static final byte RFID_REPORT_ID

      See Also:
        Constant Field Values

    - #### RFID_STX_ZY

          public static final byte RFID_STX_ZY

      See Also:
        Constant Field Values

    - #### RFID_STX_ZY1

          public static final byte RFID_STX_ZY1

      See Also:
        Constant Field Values

    - #### STX_ZY_RE

          public static final byte STX_ZY_RE

      See Also:
        Constant Field Values

    - #### GET_HIDSTRUCT_ERR

          public static final int GET_HIDSTRUCT_ERR

      See Also:
        Constant Field Values

    - #### HIDINIT_ERR

          public static final int HIDINIT_ERR

      See Also:
        Constant Field Values

    - #### HID_TIMEOUT

          public static final int HID_TIMEOUT

      See Also:
        Constant Field Values

    - #### CRC_ERR

          public static final int CRC_ERR

      See Also:
        Constant Field Values

    - #### MODE_ERR

          public static final int MODE_ERR

      See Also:
        Constant Field Values

    - #### PARAMETER_ERR

          public static final int PARAMETER_ERR

      See Also:
        Constant Field Values

    - #### READ_ERR

          public static final int READ_ERR

      See Also:
        Constant Field Values

    - #### WRITE_ERR

          public static final int WRITE_ERR

      See Also:
        Constant Field Values

    - #### FORMART_ERR

          public static final int FORMART_ERR

      See Also:
        Constant Field Values

    - #### ZY_ERR1

          public static final int ZY_ERR1

      See Also:
        Constant Field Values

    - #### ZY_ERR2

          public static final int ZY_ERR2

      See Also:
        Constant Field Values

    - #### ZY_ERR3

          public static final int ZY_ERR3

      See Also:
        Constant Field Values

    - #### ZY_ERR4

          public static final int ZY_ERR4

      See Also:
        Constant Field Values

    - #### ZY_ERR5

          public static final int ZY_ERR5

      See Also:
        Constant Field Values

    - #### ZY_ERR6

          public static final int ZY_ERR6

      See Also:
        Constant Field Values

    - #### ZY_ERR7

          public static final int ZY_ERR7

      See Also:
        Constant Field Values

    - #### ZY_ERR8

          public static final int ZY_ERR8

      See Also:
        Constant Field Values

    - #### ZY_ERR9

          public static final int ZY_ERR9

      See Also:
        Constant Field Values

    - #### ZY_ERR10

          public static final int ZY_ERR10

      See Also:
        Constant Field Values

    - #### ZY_ERR11

          public static final int ZY_ERR11

      See Also:
        Constant Field Values

    - #### ZY_ERR12

          public static final int ZY_ERR12

      See Also:
        Constant Field Values

    - #### mUSBOp

          public USBOp mUSBOp

  - ### Constructor Detail

    - #### RFIDPacket

          public RFIDPacket(UsbManager manager,
                            Context context,
                            java.lang.String AppName)

  - ### Method Detail

    - #### buildPackge

          public static int buildPackge(int[] configData,
                                        int dataLen)

    - #### resolveConfigData

          public static int resolveConfigData(int[] configData)

    - #### PS_RF_Reset

          public int PS_RF_Reset()

      Functional description: The reader resets and puts the reader into a low power state
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_Set

          public int PS_RF_Set(int inMode)

      Functional description: RFID RF switch
      Parameters:
        `inMode` - =0 Turn on the RFID RF switch
        =1 Turn off the RFID RF switch --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_Search

          public int PS_RF_Search(int[] cardNoData)

      Functional description: Search card
      Parameters:
        `cardNoData:` - RFID card number --output
      Returns:
        >0 operation successfully cardNoData length
        < 0 operation failed

    - #### PS_RF_Write

          public boolean PS_RF_Write(int inSector,
                                     int inKeyMod,
                                     int[] inKeyData,
                                     int inKeyDataLen,
                                     int[] inData,
                                     int inDataLen)

      Functional description: Writing S50 CARD
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
        `inData:` - Write card data --input
        `inDataLen:` - Write card data length --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_Read

          public int PS_RF_Read(int inSector,
                                int inKeyMod,
                                int[] inKeyData,
                                int inKeyDataLen,
                                int[] cardNoData)

      Functional description: Reading S50 CARD
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
        `cardNoData:` - Read card data --output
      Returns:
        >0 operation successfully cardNoData length
        < 0 operation failed

    - #### PS_RF_ReadValue

          public long PS_RF_ReadValue(int inSector,
                                      int inKeyMod,
                                      int[] inKeyData,
                                      int inKeyDataLen)

      Functional description: S50 card inquiry balance
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
      Returns:
        >0 operation successfully e-wallet amount
        < 0 operation failed

    - #### PS_RF_WriteValue

          public boolean PS_RF_WriteValue(int inSector,
                                          int inKeyMod,
                                          int[] inKeyData,
                                          int inKeyDataLen,
                                          long inValueData)

      Functional description: S50 card initialization wallet
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
        `inValueData:` - e-wallet initialization amount --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_IncValue

          public boolean PS_RF_IncValue(int inSector,
                                        int inKeyMod,
                                        int[] inKeyData,
                                        int inKeyDataLen,
                                        long inValueData)

      Functional description: S50 card value added
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
        `inValueData:` - e-wallet appreciation amount --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_DecValue

          public boolean PS_RF_DecValue(int inSector,
                                        int inKeyMod,
                                        int[] inKeyData,
                                        int inKeyDataLen,
                                        long inValueData)

      Functional description: S50 card Deduction amount
      Parameters:
        `inSector:` - Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
        `inValueData:` - e-wallet deduction amount --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_BackUpValue

          public boolean PS_RF_BackUpValue(int inSrcSector,
                                           int inTarSector,
                                           int inKeyMod,
                                           int[] inKeyData,
                                           int inKeyDataLen)

      Functional description: Backup wallet
      Parameters:
        `inSrcSector:` - Source Block number 0-255 --input
        `inTarSector:` - Target Block number 0-255 --input
        `inKeyMod:` - Key type 0=AKEY 1=BKEY --input
        `inKeyData:` - Key data --input
        `inKeyDataLen:` - Key data length --input
      Returns:
        = 0 operation successfully
        < 0 operation failed

    - #### PS_RF_CardSleep

          public int PS_RF_CardSleep()

      Functional description: S50 card goes to sleep state
      Returns:
        = 0 operation successfully
        < 0 operation failed