RFIDWithISO15693

com.rscja.deviceapi

## Class RFIDWithISO15693

- java.lang.Object
- - com.rscja.deviceapi.RFIDWithISO15693

-     public class RFIDWithISO15693
      extends java.lang.Object

  RFID模块ISO15693协议操作类,
  RFID module ISO15639 protocol operation type

  注意：
  Attention:
  1、使用前请确认您的机器已安装此模块。
  1. Make sure this module is installed before using your device.
  2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件
  2. Put libDeviceAPI.so file in directory \libs\armeabi\ then module can be used normally.
  3、在操作设备前需要调用 `init()` 打开设备，使用完后调用 `free()` 关闭设备
  3. Call `init()` to switch on device before using device, call `free()` to switch off the device after using.

  Author:
    liuruifeng

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RFIDWithISO15693.TagType` 标签类型 Tag type

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `free()` 释放rfid模块 Release RFID module
    `char[]` | `genericFunction_ex(char command, char IcMfg, char[] databuf, int datalen)`
    `char[]` | `genericFunction(char command, char[] databuf, char datalen)`
    `static RFIDWithISO15693` | `getInstance()` 获取ISO15693协议操作实例 Acquire ISO15693 protocol operation Instance
    `java.lang.String` | `getVersion()` 获取rfid 版本信息 Acquire RFID version infor
    `boolean` | `init()` 初始化rfid模块 initialize RFID module
    `boolean` | `init(boolean isRfOff)`
    `ISO15693Entity` | `inventory()` 读卡 read card
    `boolean` | `isPowerOn()` 判断设备是否上电 Judge the device is powered on or not.
    `boolean` | `lockAFI()` 锁定AFI lock AFI
    `boolean` | `lockDSFID()` 锁定DSFID lock DSFID
    `ISO15693Entity` | `read(int block)` 读取块数据 read block data
    `ISO15693Entity` | `read(int startBlock, int Blocklen)` 读取块数据 block data
    `boolean` | `rfidUpgrade(int packageCount, int index, int currSize, byte[] data)` 固件升级 firmware upgrade
    `boolean` | `write(int startBlock, int Blocklen, java.lang.String hexData)` 写卡 card writing
    `boolean` | `write(int block, java.lang.String hexData)` 写卡 card writing
    `boolean` | `writeAFI(int iAFI)` 写入AFI Write AFi
    `boolean` | `writeDSFID(int iDSFID)` 写入DSFID Write DSFID

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

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

- - ### Method Detail

    - #### getInstance

          public static RFIDWithISO15693 getInstance()
                                              throws ConfigurationException

      获取ISO15693协议操作实例
      Acquire ISO15693 protocol operation Instance
      Returns:
        ISO15693协议操作实例
        ISO15693 protocol operation Instance
      Throws:
        `ConfigurationException` - 配置错误异常
        Configuration err

    - #### inventory

          public ISO15693Entity inventory()

      读卡
      read card
      Returns:
        返回ISO15693Entity实体，寻卡失败返回null
        return ISO15693Entity body, card searching failed return null

    - #### read

          public ISO15693Entity read(int block)
                              throws RFIDReadFailureException

      读取块数据
      read block data
      Parameters:
        `block` - 块区
        block
      Returns:
        返回ISO15693Entity实体，寻卡失败返回null
        return ISO1593Entity body, card searching failure return null
      Throws:
        `RFIDReadFailureException` - 读卡失败异常
        card reading err

    - #### read

          public ISO15693Entity read(int startBlock,
                                     int Blocklen)
                              throws RFIDReadFailureException

      读取块数据
      block data
      Parameters:
        `block` - 块区
        block
      Returns:
        返回ISO15693Entity实体，寻卡失败返回null
        return ISO15693Entity body, card searching failure return null
      Throws:
        `RFIDReadFailureException` - 读卡失败异常
        Card reading err

    - #### write

          public boolean write(int block,
                               java.lang.String hexData)
                        throws RFIDNotFoundException

      写卡
      card writing
      Parameters:
        `block` - 块区
        block
        `hexData` - 十六进制数据
        hexdecimal data
      Returns:
        true成功，false失败
        true success, false failure
      Throws:
        `RFIDNotFoundException` - 寻卡失败异常
        card searching err

    - #### write

          public boolean write(int startBlock,
                               int Blocklen,
                               java.lang.String hexData)
                        throws RFIDNotFoundException

      写卡
      card writing
      Parameters:
        `block` - 块区
        block
        `hexData` - 十六进制数据
        hexdecimal data
      Returns:
        true成功，false失败
        true success, false failed
      Throws:
        `RFIDNotFoundException` - 寻卡失败异常
        card searching err

    - #### writeAFI

          public boolean writeAFI(int iAFI)
                           throws RFIDNotFoundException

      写入AFI
      Write AFi
      Parameters:
        `iAFI` - AFI值
        AFI value
      Returns:
        true成功，false失败
        true success, false failed
      Throws:
        `RFIDNotFoundException` - 寻卡失败异常
        card searching err

    - #### lockAFI

          public boolean lockAFI()
                          throws RFIDNotFoundException

      锁定AFI
      lock AFI
      Returns:
        true成功，false失败
        true success, false failed
      Throws:
        `RFIDNotFoundException`

    - #### writeDSFID

          public boolean writeDSFID(int iDSFID)
                             throws RFIDNotFoundException

      写入DSFID
      Write DSFID
      Parameters:
        `iDSFID` - DSFID值
        DSFID value
      Returns:
        true成功，false失败
        true success, false failed
      Throws:
        `RFIDNotFoundException` - 寻卡失败异常
        card searching err

    - #### lockDSFID

          public boolean lockDSFID()
                            throws RFIDNotFoundException

      锁定DSFID
      lock DSFID
      Returns:
        true成功，false失败
        true success, false failed
      Throws:
        `RFIDNotFoundException` - 寻卡失败异常
        card searching err

    - #### genericFunction

          public char[] genericFunction(char command,
                                        char[] databuf,
                                        char datalen)

      Parameters:
        `command` - 命令
        command
        `databuf` - 数据
        data
        `datalen` - 数据长度
        data length
      Returns:
        索引1表示状态，非零 失败， 0x00 成功，数据 64字节
        index 1 means status, NZ failed, 0x00 success, data 64 byte

    - #### genericFunction_ex

          public char[] genericFunction_ex(char command,
                                           char IcMfg,
                                           char[] databuf,
                                           int datalen)

      Parameters:
        `command` - 命令
        command
        `IcMfg` - 厂商信息
        `databuf` - 数据
        data
        `datalen` - 数据长度
        data length
      Returns:
        索引1表示状态，非零 失败， 0x00 成功，数据 64字节
        index 1 means status, NZ failed, 0x00 success, data 64 byte

    - #### init

          public boolean init()

      初始化rfid模块
      initialize RFID module
      Returns:
        true成功，false失败

    - #### init

          public boolean init(boolean isRfOff)

    - #### free

          public boolean free()

      释放rfid模块
      Release RFID module
      Returns:
        true成功，false失败
        true success, false failure

    - #### getVersion

          public java.lang.String getVersion()

      获取rfid 版本信息
      Acquire RFID version infor
      Returns:
        返回版本信息，null为失败
        return version infor, null is failure

    - #### rfidUpgrade

          public boolean rfidUpgrade(int packageCount,
                                     int index,
                                     int currSize,
                                     byte[] data)

      固件升级
      firmware upgrade
      Parameters:
        `packageCount` - 包的数量
        package amount
        `index` - 当前为第几个包
        current package
        `currSize` - 当前包大小
        current package size
        `data` - 包数据
        package data
      Returns:
        true成功，false失败
        true success, false failure

    - #### isPowerOn

          public boolean isPowerOn()

      判断设备是否上电
      Judge the device is powered on or not.
      Returns: