com.atid.lib.atx88

## Class ATx88Reader

- java.lang.Object
- - com.atid.lib.reader.ATEAReader
  - - com.atid.lib.atx88.ATx88Reader

- All Implemented Interfaces:
    com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener, com.atid.lib.device.IReader, ATransport.IConnectStateEventListener
  Direct Known Subclasses:
    ATn88Reader

      public abstract class ATx88Reader
      extends ATEAReader
      implements com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener

  The ATx88Reader class inherits from the ATEAReader class and provides the common functionality of the AT188N Device, AT388 Device, and RF Prisma Device.

- - ### Field Summary

    - ### Fields inherited from class com.atid.lib.reader.ATEAReader

      `DEFALT_BATTERY_CHECK_INTERVAL, INFO, mAction, mBarcode, mCheckBatteryInterval, mDevice, mDeviceVersion, mFailCount, mIsDisconnecting, mIsForceBatteryGauging, mLastError, mLastTime, mRfidHf, mRfidUhf, mTransport, RETRY_COUNT, TAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ATx88Reader(ATransport transport)` Create an instance of the ATx88Reader class.
    `ATx88Reader(int sessionId, ATransport transport)` Create an instance of the ATx88Reader class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `assertAction()`
    `ResultCode` | `defaultParameter()` Reset all attributes of the device to default values.
    `void` | `destroy()` Destroys an instance of the ATEAReader class and cleans up resources.
    `int` | `getAutoOffTime()` Returns the time at which the instrument automatically turns off.
    `boolean` | `getAutoSaveMode()` When the device reads a tag or barcode, it returns whether to store it in the device internal memory.
    `int` | `getBatteryState()` Returns the state of the equipment.
    `BuzzerState` | `getBuzzer()` Returns the buzzer operation status of the equipment.
    `int` | `getDisplayOffTime()` Returns the time to turn off the display automatically when the device is not in use.
    `OperationMode` | `getOperationMode()` Returns the current operating mode of the instrument.
    `java.lang.String` | `getSerialNo()` Returns the serial number of the device.
    `int` | `getStoredTagCount()` Returns the number of data stored in the device's internal memory.
    `java.util.Date` | `getTime()` Returns the system time of the device.
    `boolean` | `getUseActionKey()` Returns whether to use the action of the Trigger button on the instrument.
    `boolean` | `initReader()` Initializes an ATEAReader instance after the ATEAReader instance is associated with the device.
    `ResultCode` | `loadStoredData()` Read the data stored in the device.
    `void` | `onActionChanged(ResultCode code, ActionType action, java.lang.Object params)`
    `void` | `onBatteryState(int batteryState, java.lang.Object params)`
    `void` | `onEvent(int sub, byte[] data)`
    `void` | `onKeyEvent(KeyType type, KeyState state, java.lang.Object params)`
    `void` | `onNotificationState(NotificationState state, java.lang.Object params)`
    `void` | `onOperationModeChanged(OperationMode mode, java.lang.Object params)`
    `void` | `onStateChanged(ConnectState state, java.lang.Object params)` Called when the connection state of the ATransport instance and the device changes.
    `void` | `onUsbChargerChanged(UsbChargerType type, UsbChargerState state, java.lang.Object params)`
    `ResultCode` | `removeAllStoreadData()` Deletes all data stored in the device.
    `ResultCode` | `reset()` Reset the device.
    `ResultCode` | `saveStoredData(StoredDataList datas)` Store tag data or barcode data on the instrument.
    `void` | `setAutoOffTime(int time)` Sets the time at which the equipment automatically turns off.
    `void` | `setAutoSaveMode(boolean enabled)` When the device reads a tag or barcode, it sets whether or not to store it in the internal memory of the device.
    `void` | `setBuzzer(BuzzerState state)` Sets the buzzer operation status of the equipment.
    `void` | `setDisplayOffTime(int time)` Sets the time to turn off the display automatically when not using the device.
    `void` | `setOperationMode(OperationMode mode)` Sets the current operating mode of the instrument.
    `void` | `setSerialNo(java.lang.String serialNo)` Set the serial number of the device.
    `void` | `setTime(java.util.Date time)` Sets the system time of the instrument.
    `void` | `setUsbChargingPhone(UsbChargerControl contorl)` Set whether or not to enable charging the phone. ( USB communication will be lost when charging the phone. ) Only ATS100 is supported.
    `void` | `setUseActionKey(boolean enabled)` Set whether or not to use the operation of the Trigger button of the equipment.
    `void` | `sleep()` An instance of the ATEAReader class is called before an active Host device goes to sleep.
    `void` | `sleep(IATEAReaderEventListener listener)` An instance of the ATEAReader class is called before an active Host device goes to sleep.
    `void` | `wakeUp()` An instance of the ATEAReader class is called when an active Host device is in the Sleep state and wakes up.
    `void` | `wakeUp(IATEAReaderEventListener listener)` An instance of the ATEAReader class is called when an active Host device is in the Sleep state and wakes up.

    - ### Methods inherited from class com.atid.lib.reader.ATEAReader

      `addListener, checkError, clearListener, connect, disconnect, getAction, getAddress, getAlertNotify, getAutoConnect, getBackupState, getBarcode, getButtonNotify, getButtonNotifyTime, getCheckInterval, getConnectType, getDeviceAttached, getDeviceName, getDeviceType, getFullVersionHexa, getLastError, getProtocol, getRfidHf, getRfidUhf, getSessionId, getState, getTransport, getVersion, getVersionHexa, isEmptyRef, listen, onReaderActionChanged, onReaderBatteryState, onReaderKeyChanged, onReaderNotificationState, onReaderOperationModeChanged, onReaderStateChanged, onReaderUsbChargerChanged, removeListener, resetError, setAction, setAddress, setAlertNotify, setAutoConnect, setButtonNotify, setButtonNotifyTime, setCheckInterval, setDeviceName, setDeviceType, setForceBatteryGauging, setLastError, toString`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ATx88Reader

          public ATx88Reader(ATransport transport)

      Create an instance of the ATx88Reader class.
      Parameters:
        `transport` - ATx88Reader An instance of an inherited class of the ATransport class that defines how an instance is associated with a Device.

    - #### ATx88Reader

          public ATx88Reader(int sessionId,
                             ATransport transport)

      Create an instance of the ATx88Reader class.
      Parameters:
        `sessionId` - A unique ID number for identifying instances to manage multiple instances.
        `transport` - ATx88Reader An instance of an inherited class of the ATransport class that defines how an instance is associated with a Device.

  - ### Method Detail

    - #### destroy

          public void destroy()

      Description copied from class: `ATEAReader`
      Destroys an instance of the ATEAReader class and cleans up resources.
      Overrides:
        `destroy` in class `ATEAReader`

    - #### wakeUp

          public void wakeUp()

      Description copied from class: `ATEAReader`
      An instance of the ATEAReader class is called when an active Host device is in the Sleep state and wakes up.
      Overrides:
        `wakeUp` in class `ATEAReader`

    - #### wakeUp

          public void wakeUp(IATEAReaderEventListener listener)

      Description copied from class: `ATEAReader`
      An instance of the ATEAReader class is called when an active Host device is in the Sleep state and wakes up.
      Overrides:
        `wakeUp` in class `ATEAReader`
      Parameters:
        `listener` - An instance of IATEAReaderEventListener to receive events when an instance of ATEAReader is woken up.

    - #### sleep

          public void sleep()

      Description copied from class: `ATEAReader`
      An instance of the ATEAReader class is called before an active Host device goes to sleep.
      Overrides:
        `sleep` in class `ATEAReader`

    - #### sleep

          public void sleep(IATEAReaderEventListener listener)

      Description copied from class: `ATEAReader`
      An instance of the ATEAReader class is called before an active Host device goes to sleep.
      Overrides:
        `sleep` in class `ATEAReader`
      Parameters:
        `listener` - An instance of IATEAReaderEventListener to unblock events when an instance of ATEAReader is sleeping.

    - #### reset

          public ResultCode reset()

      Description copied from class: `ATEAReader`
      Reset the device.
      Specified by:
        `reset` in class `ATEAReader`
      Returns:
        The ResultCode enumeration indicating the result of the method's operation.

    - #### defaultParameter

          public ResultCode defaultParameter()

      Description copied from class: `ATEAReader`
      Reset all attributes of the device to default values. ATD100 is not supported.
      Specified by:
        `defaultParameter` in class `ATEAReader`
      Returns:
        The ResultCode enumeration indicating the result of the method's operation.

    - #### loadStoredData

          public ResultCode loadStoredData()

      Description copied from class: `ATEAReader`
      Read the data stored in the device. ATS100 or ATD100 is not supported.
      Specified by:
        `loadStoredData` in class `ATEAReader`
      Returns:
        The ResultCode enumeration indicating the result of the method's operation.

    - #### saveStoredData

          public ResultCode saveStoredData(StoredDataList datas)

      Description copied from class: `ATEAReader`
      Store tag data or barcode data on the instrument. ATS100 or ATD100 is not supported.
      Specified by:
        `saveStoredData` in class `ATEAReader`
      Parameters:
        `datas` - An instance of StoredDataList that maintains a list of data to store.
      Returns:
        The ResultCode enumeration indicating the result of the method's operation.

    - #### removeAllStoreadData

          public ResultCode removeAllStoreadData()

      Description copied from class: `ATEAReader`
      Deletes all data stored in the device. ATS100 or ATD100 is not supported.
      Specified by:
        `removeAllStoreadData` in class `ATEAReader`
      Returns:
        The ResultCode enumeration indicating the result of the method's operation.

    - #### getBuzzer

          public BuzzerState getBuzzer()
                                throws ATException

      Description copied from class: `ATEAReader`
      Returns the buzzer operation status of the equipment. RF Prisma equipment only
      Specified by:
        `getBuzzer` in class `ATEAReader`
      Returns:
        To specify the status of the equipment's buzzer BuzzerState enumeration.
      Throws:
        `ATException` - Sets or returns the data for the equipment fails, the data poked ATException exception occurs.

    - #### setBuzzer

          public void setBuzzer(BuzzerState state)
                         throws ATException

      Description copied from class: `ATEAReader`
      Sets the buzzer operation status of the equipment. RF Prisma equipment only
      Specified by:
        `setBuzzer` in class `ATEAReader`
      Parameters:
        `state` - To specify the status of the buzzer BuzzerState enumeration.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getUseActionKey

          public boolean getUseActionKey()
                                  throws ATException

      Description copied from class: `ATEAReader`
      Returns whether to use the action of the Trigger button on the instrument. ATD100 is not supported.
      Specified by:
        `getUseActionKey` in class `ATEAReader`
      Returns:
        Returns true if the instrument's trigger button is in use, false if not.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setUseActionKey

          public void setUseActionKey(boolean enabled)
                               throws ATException

      Description copied from class: `ATEAReader`
      Set whether or not to use the operation of the Trigger button of the equipment. ATD100 is not supported.
      Specified by:
        `setUseActionKey` in class `ATEAReader`
      Parameters:
        `enabled` - A boolean specifying whether to use the trigger button.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getBatteryState

          public int getBatteryState()
                              throws ATException

      Description copied from class: `ATEAReader`
      Returns the state of the equipment.
      Specified by:
        `getBatteryState` in class `ATEAReader`
      Returns:
        This is an integer type that specifies the battery status of the device from 0 to 4 in 5 steps.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getDisplayOffTime

          public int getDisplayOffTime()
                                throws ATException

      Returns the time to turn off the display automatically when the device is not in use. ATS100 or ATD100 is not supported.
      Returns:
        An integer representing the time in milliseconds.
      Throws:
        `ATException` - Sets or returns the data for the equipment fails, the data poked ATException exception occurs.

    - #### setDisplayOffTime

          public void setDisplayOffTime(int time)
                                 throws ATException

      Sets the time to turn off the display automatically when not using the device. ATS100 or ATD100 is not supported.
      Parameters:
        `time` - An integer representing the time in milliseconds.
      Throws:
        `ATException` - Sets or returns the data for the equipment fails, the data poked ATException exception occurs.

    - #### getAutoOffTime

          public int getAutoOffTime()
                             throws ATException

      Description copied from class: `ATEAReader`
      Returns the time at which the instrument automatically turns off.
      Specified by:
        `getAutoOffTime` in class `ATEAReader`
      Returns:
        This is an integer that indicates the time that the device is turned off automatically.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setAutoOffTime

          public void setAutoOffTime(int time)
                              throws ATException

      Description copied from class: `ATEAReader`
      Sets the time at which the equipment automatically turns off.
      Specified by:
        `setAutoOffTime` in class `ATEAReader`
      Parameters:
        `time` - An integer that indicates how long the device will automatically turn itself off. The time unit is specified in seconds. If you set the time to 0, the instrument will not turn off automatically.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getOperationMode

          public OperationMode getOperationMode()
                                         throws ATException

      Description copied from class: `ATEAReader`
      Returns the current operating mode of the instrument.
      Specified by:
        `getOperationMode` in class `ATEAReader`
      Returns:
        An OperationMode enum indicating the operating mode of the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setOperationMode

          public void setOperationMode(OperationMode mode)
                                throws ATException

      Description copied from class: `ATEAReader`
      Sets the current operating mode of the instrument. Only ATD100 is supported Normal Operation Mode.
      Specified by:
        `setOperationMode` in class `ATEAReader`
      Parameters:
        `mode` - An OperationMode enum indicating the operating mode of the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getTime

          public java.util.Date getTime()
                                 throws ATException

      Description copied from class: `ATEAReader`
      Returns the system time of the device. ATS100 or ATD100 is not supported.
      Specified by:
        `getTime` in class `ATEAReader`
      Returns:
        An instance of Date representing the current date and time on the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setTime

          public void setTime(java.util.Date time)
                       throws ATException

      Description copied from class: `ATEAReader`
      Sets the system time of the instrument. ATS100 or ATD100 is not supported.
      Specified by:
        `setTime` in class `ATEAReader`
      Parameters:
        `time` - An instance of Date representing the current date and time on the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getSerialNo

          public java.lang.String getSerialNo()
                                       throws ATException

      Description copied from class: `ATEAReader`
      Returns the serial number of the device.
      Overrides:
        `getSerialNo` in class `ATEAReader`
      Returns:
        A string representing the serial number of the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setSerialNo

          public void setSerialNo(java.lang.String serialNo)
                           throws ATException

      Description copied from class: `ATEAReader`
      Set the serial number of the device.
      Specified by:
        `setSerialNo` in class `ATEAReader`
      Parameters:
        `serialNo` - A string representing the serial number of the device.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getStoredTagCount

          public int getStoredTagCount()
                                throws ATException

      Description copied from class: `ATEAReader`
      Returns the number of data stored in the device's internal memory. ATS100 or ATD100 is not supported.
      Specified by:
        `getStoredTagCount` in class `ATEAReader`
      Returns:
        An integer representing the number of data stored in the internal memory.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getAutoSaveMode

          public boolean getAutoSaveMode()
                                  throws ATException

      When the device reads a tag or barcode, it returns whether to store it in the device internal memory. ATS100 or ATD100 is not supported.
      Returns:
        A boolean indicating whether data should be saved.
      Throws:
        `ATException` - Sets or returns the data for the equipment fails, the data poked ATException exception occurs.

    - #### setAutoSaveMode

          public void setAutoSaveMode(boolean enabled)
                               throws ATException

      When the device reads a tag or barcode, it sets whether or not to store it in the internal memory of the device. ATS100 or ATD100 is not supported.
      Parameters:
        `enabled` - A boolean indicating whether data should be saved.
      Throws:
        `ATException` - Sets or returns the data for the equipment fails, the data poked ATException exception occurs.

    - #### setUsbChargingPhone

          public void setUsbChargingPhone(UsbChargerControl contorl)
                                   throws ATException

      Set whether or not to enable charging the phone. ( USB communication will be lost when charging the phone. ) Only ATS100 is supported.
      Parameters:
        `contorl` - A boolean specifying whether to enabled charging the phone.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### onStateChanged

          public void onStateChanged(ConnectState state,
                                     java.lang.Object params)

      Description copied from interface: `ATransport.IConnectStateEventListener`
      Called when the connection state of the ATransport instance and the device changes.
      Specified by:
        `onStateChanged` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`
      Specified by:
        `onStateChanged` in interface `ATransport.IConnectStateEventListener`
      Specified by:
        `onStateChanged` in class `ATEAReader`
      Parameters:
        `state` - A ConnectState enumeration that indicates the device and its connection status.
        `params` - This parameter is used to transmit additional information that is generated when the device and connection are changed.

    - #### onActionChanged

          public void onActionChanged(ResultCode code,
                                      ActionType action,
                                      java.lang.Object params)

      Specified by:
        `onActionChanged` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onOperationModeChanged

          public void onOperationModeChanged(OperationMode mode,
                                             java.lang.Object params)

      Specified by:
        `onOperationModeChanged` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onBatteryState

          public void onBatteryState(int batteryState,
                                     java.lang.Object params)

      Specified by:
        `onBatteryState` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onKeyEvent

          public void onKeyEvent(KeyType type,
                                 KeyState state,
                                 java.lang.Object params)

      Specified by:
        `onKeyEvent` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onUsbChargerChanged

          public void onUsbChargerChanged(UsbChargerType type,
                                          UsbChargerState state,
                                          java.lang.Object params)

      Specified by:
        `onUsbChargerChanged` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onNotificationState

          public void onNotificationState(NotificationState state,
                                          java.lang.Object params)

      Specified by:
        `onNotificationState` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### onEvent

          public void onEvent(int sub,
                              byte[] data)

      Specified by:
        `onEvent` in interface `com.atid.lib.atx88.device.ATDeviceATx88.IDeviceEventListener`

    - #### initReader

          public boolean initReader()

      Description copied from class: `ATEAReader`
      Initializes an ATEAReader instance after the ATEAReader instance is associated with the device.
      Specified by:
        `initReader` in class `ATEAReader`
      Returns:
        Returns true if successful, false against failure

    - #### assertAction

          protected void assertAction()
                               throws ATException

      Throws:
        `ATException`