com.rscja.deviceapi

## Class RFIDWithUHFA4

- java.lang.Object
- - com.rscja.deviceapi.UhfBase
  - - com.rscja.deviceapi.RFIDWithUHFUART
    - - com.rscja.deviceapi.RFIDWithUHFAxBase
      - - com.rscja.deviceapi.RFIDWithUHFA4

- All Implemented Interfaces:
    IHandheldRFID, IMultipleAntenna, IRFIDWithUHFA4, ISingleAntenna, IUHF, IUHFOfAndroidUart, IURAxOfAndroidUart

      public class RFIDWithUHFA4
      extends RFIDWithUHFAxBase
      implements IRFIDWithUHFA4

  UHF模块 A4操作类
  UHF module operation type
  第一步:通过`RFIDWithUHFUART.init(Context context)` 连接读写器。
  Step 1: Connect to the usb of the reader via`RFIDWithUHFUART.init(Context context)`
  第二步： 如果是设置参数，连接成功之后，调用对应的函数设置参数、读写操作。 如果是盘点调用`RFIDWithUHFUART.startInventoryTag()`函数开始执行盘点。 注意: 在盘点标签的时候rfid模块只能响应`RFIDWithUHFUART.stopInventory()`函数。
  Step 2: If it is to set parameters, after the connection is successful, call the corresponding function to set parameters, read and write operations. * If the inventory label is to call `RFIDWithUHFUART.startInventoryTag()` function to start the inventory. * Note: The rfid module can only respond to the `RFIDWithUHFUART.stopInventory()` function when inventorying tags.
  第三步：退出app调用 `RFIDWithUHFUART.free()`断开连接，如果断开之前正在盘点，请先停止盘点，在断开连接。
  Step 3: Exit the app and call `RFIDWithUHFUART.free()` to disconnect. If you are taking inventory before disconnecting, please stop the inventory first and then disconnecting.
  Example Usage:
  public class UHFDemo() {
  RFIDWithUHFA4 rfid = RFIDWithUHFA4.getInstance();
  boolean isInventory=false;
  public void uhf(){
  boolean result = rfid.init(context);
  if (!result) {
  //connect fail
  return;
  }
  //connect success
  //configuration parameters
  // rfid.setFrequencyMode(xx);
  // rfid.setPower(30);
  if (rfid.startInventoryTag()) {
  //success
  isInventory=true;
  new ThreadInventory().start();
  } else {
  rfid.stopInventory();
  //fail
  }
  //..............
  rfid.stopInventory();
  isInventory=false;
  //.................
  //disconnect uhf
  rfid.free();
  }
  private class ThreadInventory extends Thread{
  @Override
  public void run(){
  while (isInventory){
  UHFTAGInfo uhftagInfo= rfid.readTagFromBuffer();
  if(uhftagInfo==null){
  Thread.sleep(20);
  continue;
  }
  String epc= uhftagInfo.getEPC();
  String rssi= uhftagInfo.getRssi();
  //.....
  }
  }
  }
  }

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.rscja.deviceapi.UhfBase

      `UhfBase.ErrorCode`

  - ### Field Summary

    - ### Fields inherited from interface com.rscja.deviceapi.interfaces.IUHF

      `Bank_EPC, Bank_RESERVED, Bank_TID, Bank_USER, LockBank_ACCESS, LockBank_EPC, LockBank_KILL, LockBank_TID, LockBank_USER, LockMode_LOCK, LockMode_OPEN, LockMode_PLOCK, LockMode_POPEN, UPDATE_UHF`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RFIDWithUHFA4` | `getInstance()`
    `java.util.List<GPIStateEntity>` | `inputStatus()` input status
    `boolean` | `output1Off()` gpio 1 off
    `boolean` | `output1On()` gpio 1 on
    `boolean` | `output2Off()` gpio 2 off
    `boolean` | `output2On()` gpio2 on
    `boolean` | `output3Off()` gpio OptoCoupler3 off
    `boolean` | `output3On()` gpio OptoCoupler3 on
    `boolean` | `output4Off()` gpio OptoCoupler4 off
    `boolean` | `output4On()` gpio OptoCoupler4 on
    `boolean` | `outputWgData0Off()` gpio WgData0 off
    `boolean` | `outputWgData0On()` gpio WgData0 on
    `boolean` | `outputWgData1Off()` gpio WgData1 off
    `boolean` | `outputWgData1On()` gpio WgData1 on

    - ### Methods inherited from class com.rscja.deviceapi.RFIDWithUHFAxBase

      `buzzer, getANT, getAntennaPower, getAntennaWorkTime, led, setANT, setAntennaPower, setAntennaWorkTime, successNotify`

    - ### Methods inherited from class com.rscja.deviceapi.RFIDWithUHFUART

      `blockWriteData, eraseData, eraseData, free, generateLockCode, getConnectStatus, getCW, getEPCAndTIDUserMode, getErrCode, getFrequencyMode, getGen2, getHardwareVersion, getPower, getProtocol, getPwm, getRFLink, getTemperature, getVersion, init_R2000, init, init, inventorySingleTag, isPowerOn, isWorking, killTag, killTag, lockMem, lockMem, readData, readData, readTagFromBuffer, setConnectionStatusCallback, setCW, setEPCAndTIDMode, setEPCAndTIDUserMode, setEPCAndUserReservedModeEx, setEPCMode, setFastID, setFilter, setFreHop, setFrequencyMode, setGen2, setInventoryCallback, setPower, setPowerOnBySystem, setProtocol, setPwm, setRFLink, setTagFocus, setUart, startInventoryTag, startInventoryTag, startLocation, stopInventory, stopLocation, uhfBlockPermalock, uhfJump2Boot, uhfJump2Boot, uhfStartUpdate, uhfStopUpdate, uhfUpdating, writeData, writeData, writeDataToEpc, writeDataToEpc`

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

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

    - ### Methods inherited from interface com.rscja.deviceapi.interfaces.IMultipleAntenna

      `getANT, getAntennaPower, getAntennaWorkTime, setANT, setAntennaPower, setAntennaWorkTime`

- - ### Method Detail

    - #### getInstance

          public static RFIDWithUHFA4 getInstance()
                                           throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### output2Off

          public boolean output2Off()

      gpio 2 off
      Specified by:
        `output2Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output2On

          public boolean output2On()

      gpio2 on
      Specified by:
        `output2On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output1Off

          public boolean output1Off()

      gpio 1 off
      Specified by:
        `output1Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output1On

          public boolean output1On()

      gpio 1 on
      Specified by:
        `output1On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### inputStatus

          public java.util.List<GPIStateEntity> inputStatus()

      input status
      Specified by:
        `inputStatus` in interface `IRFIDWithUHFA4`
      Returns:
        null:fail

    - #### output3On

          public boolean output3On()

      gpio OptoCoupler3 on
      Specified by:
        `output3On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail OPTOCOUPLER

    - #### output3Off

          public boolean output3Off()

      gpio OptoCoupler3 off
      Specified by:
        `output3Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output4On

          public boolean output4On()

      gpio OptoCoupler4 on
      Specified by:
        `output4On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output4Off

          public boolean output4Off()

      gpio OptoCoupler4 off
      Specified by:
        `output4Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData0On

          public boolean outputWgData0On()

      gpio WgData0 on
      Specified by:
        `outputWgData0On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData0Off

          public boolean outputWgData0Off()

      gpio WgData0 off
      Specified by:
        `outputWgData0Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData1On

          public boolean outputWgData1On()

      gpio WgData1 on
      Specified by:
        `outputWgData1On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData1Off

          public boolean outputWgData1Off()

      gpio WgData1 off
      Specified by:
        `outputWgData1Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail