RFIDWithLF

com.rscja.deviceapi

## Class RFIDWithLF

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

-     public class RFIDWithLF
      extends java.lang.Object

  RFID低频（125K）操作类
  RFID LF (125K) 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 the module can be used normally.
  3、在操作设备前需要调用 `init()` 打开设备，使用完后调用 `free()` 关闭设备
  3. call `init()` to switch on the device before operating the device
  , call `free()` to switch off the device after using.

  Author:
    liuruifeng

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `configFDXTag(char[] cidbuf, char[] nidbuf)` EM4305 配置成动物标签 EM4305 configurate animal tag
    `java.lang.String` | `EM125k_ReadHitag1()` 获取所有页的数据 Acquire data of all pages
    `boolean` | `free()` 释放RFID低频模块 Release RFID LF module
    `java.lang.String` | `getHardwareVersion()` 读取硬件版本 read hardware version
    `static RFIDWithLF` | `getInstance()` 获取RFID低频操作实例 Acquire RFID LF operation Instance
    `java.lang.String` | `getUIDWith4450Card()` 获取UID,用于4450Card Acquire UID, used for 4450 card
    `int` | `getUIDWithHID()` 读取HID卡 Read HID card
    `java.lang.String` | `getUIDWithHitagS()` 获取UID,用于hitag S Acquire UID, used for hitag S
    `boolean` | `init()` 初始化RFID低频模块 Initialize RFID LF module
    `boolean` | `initWithNeedleTag()` 初始化RFID低频模块，针对针管标签 Initialize RFID LF module, for needle tube tag
    `boolean` | `isPowerOn()` 判断设备是否上电 Judge the device is powered on or not.
    `AnimalEntity` | `readAnimalTags(int iMode)` 读取动物标签信息 read animal tag infor
    `java.lang.String` | `readDataWith4305Card(int nPage)` 读4305卡的某一页（0~31）数据 read card 4305 data of random page (0-31)
    `java.lang.String` | `readDataWithHitagS(int nPage)` 读取Hitag S卡中的某一页的数据 Read data of random page in Hitag S card
    `java.lang.String` | `readDataWithIDCard(int iMode)` 读卡,用于ID卡 card reading, used for ID card
    `java.lang.String` | `readWithNeedleTag()` 读数据，针对针管标签 read data, for needle tube tag
    `boolean` | `writeDataWith4305Card(int nPage, java.lang.String hexData)` 写4305卡的某一页（0~31）数据 write data in card 4305 at random page (0-31)
    `boolean` | `writeDataWithHitagS(int nPage, java.lang.String hexData)` 写Hitag S卡中的某一页的数据 Write data of random page in Hitag S card

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

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

- - ### Method Detail

    - #### getInstance

          public static RFIDWithLF getInstance()
                                        throws ConfigurationException

      获取RFID低频操作实例
      Acquire RFID LF operation Instance
      Returns:
      Throws:
        `ConfigurationException` - 配置错误异常
        Configuration err

    - #### init

          public boolean init()

      初始化RFID低频模块
      Initialize RFID LF module
      Parameters:
        `config` - 配置信息实例
        Configuration Infor example
      Returns:
        true成功，false失败
        true success, false failed

    - #### free

          public boolean free()

      释放RFID低频模块
      Release RFID LF module
      Returns:
        true成功，false失败
        ture success, false failure

    - #### getHardwareVersion

          public java.lang.String getHardwareVersion()

      读取硬件版本
      read hardware version
      Returns:
        硬件版本,null表示读取失败
        hardware version, null means reading failure

    - #### readDataWithIDCard

          public java.lang.String readDataWithIDCard(int iMode)

      读卡,用于ID卡
      card reading, used for ID card
      Parameters:
        `iMode` - 模式切换 0 为只读ID；1 为只读动物标签 2为读半双工动物标签
        Profile switching 0 is read-only ID; 1 is read-only animal tag. 2 is read half-duplex animal tag
      Returns:
        读取到的数据信息 ,失败则返回null
        read data infor, failure return null

    - #### readAnimalTags

          public AnimalEntity readAnimalTags(int iMode)

      读取动物标签信息
      read animal tag infor
      Parameters:
        `iMode` - 1,全双工 ；2半双工
        1. full duplex; 2 half duplex
      Returns:
        动物标签信息，失败则返回null
        animal tag infor, failure return null

    - #### readDataWithHitagS

          public java.lang.String readDataWithHitagS(int nPage)

      读取Hitag S卡中的某一页的数据
      Read data of random page in Hitag S card
      Parameters:
        `nPage` - 页码
        page
      Returns:
        读取到的数据信息 ,失败则返回null
        read data, failure return null

    - #### writeDataWithHitagS

          public boolean writeDataWithHitagS(int nPage,
                                             java.lang.String hexData)

      写Hitag S卡中的某一页的数据
      Write data of random page in Hitag S card
      Parameters:
        `nPage` - 页码
        Page
        `hexData` - 要写入的十六进制数据
        write hexdecimal data
      Returns:
        true成功，false失败
        true success, false failed

    - #### readDataWith4305Card

          public java.lang.String readDataWith4305Card(int nPage)

      读4305卡的某一页（0~31）数据
      read card 4305 data of random page (0-31)
      Parameters:
        `nPage` - 页码
        page
      Returns:
        读取到的数据信息 ,失败则返回null
        read data, failed return null

    - #### writeDataWith4305Card

          public boolean writeDataWith4305Card(int nPage,
                                               java.lang.String hexData)

      写4305卡的某一页（0~31）数据
      write data in card 4305 at random page (0-31)
      Parameters:
        `nPage` - 页码
        page
        `hexData` - 要写入的十六进制数据
        hexdecimal data needs to be written
      Returns:
        true成功，false失败
        ture success, false failed

    - #### getUIDWithHID

          public int getUIDWithHID()

      读取HID卡
      Read HID card
      Returns:
        卡号，返回-1为读取失败
        card, return -1 means reading failed

    - #### getUIDWithHitagS

          public java.lang.String getUIDWithHitagS()

      获取UID,用于hitag S
      Acquire UID, used for hitag S
      Returns:
        读取到的UID信息,失败则返回null
        read UID infor, failure return null

    - #### getUIDWith4450Card

          public java.lang.String getUIDWith4450Card()

      获取UID,用于4450Card
      Acquire UID, used for 4450 card
      Returns:
        读取到的UID信息,失败则返回null
        read UID infor, failure return null

    - #### initWithNeedleTag

          public boolean initWithNeedleTag()

      初始化RFID低频模块，针对针管标签
      Initialize RFID LF module, for needle tube tag
      Parameters:
        `config` - 配置信息实例
        configuration info example
      Returns:
        true成功，false失败
        true succes, false failed

    - #### readWithNeedleTag

          public java.lang.String readWithNeedleTag()

      读数据，针对针管标签
      read data, for needle tube tag
      Returns:
        读取到的数据信息(十六进制) ,失败则返回null
        read hexdecimal data, failure return null

    - #### configFDXTag

          public int configFDXTag(char[] cidbuf,
                                  char[] nidbuf)

      EM4305 配置成动物标签
      EM4305 configurate animal tag
      Parameters:
        `cidbuf` - 16进制 2字节， 如cid 为156， 转成 0x00 0x9C
        cidbuf hexdecimal 2 byte, e.g.cid is 156, transform into 0x00 0x9C
        `nidbuf` - 16进制 5字节， 如nid 为123456789 ,转成 0x00 0x07 0x5B 0xCD 0x15
        nidbuf hexdecimal 5 byte, e.g. nid is 1234456789, transform into 0x00 0x07 0x5B 0xCD 0x15
      Returns:
        0成功，非零失败
        0 success, NZ failure

    - #### EM125k_ReadHitag1

          public java.lang.String EM125k_ReadHitag1()

      获取所有页的数据
      Acquire data of all pages
      Returns:
        读取到的数据信息 ,失败则返回null
        read data, failure return null

    - #### isPowerOn

          public boolean isPowerOn()

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