public abstract class ATEAReader extends java.lang.Object implements com.atid.lib.device.IReader, ATransport.IConnectStateEventListener
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFALT_BATTERY_CHECK_INTERVAL |
protected static int |
INFO |
protected ActionState |
mAction |
protected ATBarcode |
mBarcode |
protected int |
mCheckBatteryInterval |
protected com.atid.lib.reader.device.ATDevice |
mDevice |
protected com.atid.lib.util.Version |
mDeviceVersion |
protected int |
mFailCount |
protected boolean |
mIsDisconnecting |
protected boolean |
mIsForceBatteryGauging |
protected ResultCode |
mLastError |
protected long |
mLastTime |
protected com.atid.lib.module.rfid.hf.ATRfidHf |
mRfidHf |
protected ATRfidUhf |
mRfidUhf |
protected ATransport |
mTransport |
protected static int |
RETRY_COUNT |
protected java.lang.String |
TAG |
Constructor and Description |
---|
ATEAReader(ATransport transport)
Creates an instance of ATEAReader.
|
ATEAReader(int sessionId,
ATransport transport)
Creates an instance of ATEAReader.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(IATEAReaderEventListener listener)
Adds a Listener to receive events on an instance of the ATEAReader class.
|
void |
checkError()
Use only within the SDK.
|
void |
clearListener()
Removes all listeners registered on an instance of the ATEAReader class.
|
boolean |
connect()
An instance of the ATEAReader class tries to connect to the configured address
|
abstract ResultCode |
defaultParameter()
Reset all attributes of the device to default values.
|
void |
destroy()
Destroys an instance of the ATEAReader class and cleans up resources.
|
void |
disconnect()
Causes an instance of the ATEAReader class to disconnect from the connected device.
|
ActionState |
getAction()
Returns the current behavior of the device associated with an instance of the ATEAReader class.
|
java.lang.String |
getAddress()
Returns the address of the device associated with an instance of the ATEAReader class.
|
abstract NotifyMethod |
getAlertNotify()
Returns the alert Notify method of the instrument.
|
boolean |
getAutoConnect()
Returns whether automatically connect to the device with the instance of the ATEAReader class.
|
abstract int |
getAutoOffTime()
Returns the time at which the instrument automatically turns off.
|
protected ConnectState |
getBackupState() |
ATBarcode |
getBarcode()
If the ATEAReader instance supports the Barcode module,
it returns an interface object that can control the Barcode module.
|
abstract int |
getBatteryState()
Returns the state of the equipment.
|
abstract NotifyMethod |
getButtonNotify()
Returns the button Notify method of the equipment.
|
abstract NotifyTimeType |
getButtonNotifyTime()
Returns the button's Notify hold time.
|
abstract BuzzerState |
getBuzzer()
Returns the buzzer operation status of the equipment.
|
int |
getCheckInterval()
Returns the time period for checking the battery status of the device associated with an instance of the ATEAReader class.
|
ConnectType |
getConnectType()
Returns the instance of ATEAReader associated with device.
|
boolean |
getDeviceAttached()
Returns whether attached to the device with the instance of the ATEAReader class..
|
java.lang.String |
getDeviceName()
Returns the name of the Device associated with an instance of the ATEAReader class.
|
DeviceType |
getDeviceType()
ATEAReader Returns the type of Device to which the instance is connected.
|
int |
getFullVersionHexa()
Returns the hw & firmware version of the device associated with the instance of the ATEAReader class.
|
ResultCode |
getLastError()
Returns the result code for the last action.
|
abstract OperationMode |
getOperationMode()
Returns the current operating mode of the instrument.
|
com.atid.lib.protocol.IProtocol |
getProtocol()
Use only within the SDK.
|
com.atid.lib.module.rfid.hf.ATRfidHf |
getRfidHf()
If the ATEAReader instance supports the RFID HF module,
it returns an interface object that can control the RFID HF module.
|
ATRfidUhf |
getRfidUhf()
If the ATEAReader instance supports the RFID UHF module,
it returns an interface object that can control the RFID UHF module.
|
java.lang.String |
getSerialNo()
Returns the serial number of the device.
|
int |
getSessionId()
Returns the Session ID of the ATEAReader instance.
|
ConnectState |
getState()
Returns the connection status of the device with the instance of the ATEAReader class.
|
abstract int |
getStoredTagCount()
Returns the number of data stored in the device's internal memory.
|
abstract java.util.Date |
getTime()
Returns the system time of the device.
|
ATransport |
getTransport()
Returns an instance of the ATransport class that connects an instance of the ATEAReader class to the Device.
|
abstract boolean |
getUseActionKey()
Returns whether to use the action of the Trigger button on the instrument.
|
java.lang.String |
getVersion()
Returns the firmware version of the device associated with the instance of the ATEAReader class.
|
int |
getVersionHexa()
Returns the firmware version of the device associated with the instance of the ATEAReader class.
|
abstract boolean |
initReader()
Initializes an ATEAReader instance after the ATEAReader instance is associated with the device.
|
protected boolean |
isEmptyRef()
Checks if an instance of the ATEAReader class is currently being referenced.
|
void |
listen()
Allows the ATEAReader class to wait for connection until the connection is made from the device.
|
abstract ResultCode |
loadStoredData()
Read the data stored in the device.
|
protected void |
onReaderActionChanged(ResultCode code,
ActionState action,
java.lang.Object params) |
protected void |
onReaderBatteryState(int batteryState,
java.lang.Object params) |
protected void |
onReaderKeyChanged(KeyType type,
KeyState state,
java.lang.Object params) |
protected void |
onReaderNotificationState(NotificationState state,
java.lang.Object params) |
protected void |
onReaderOperationModeChanged(OperationMode mode,
java.lang.Object params) |
protected void |
onReaderStateChanged(ConnectState state,
java.lang.Object params) |
protected void |
onReaderUsbChargerChanged(UsbChargerType type,
UsbChargerState state,
java.lang.Object params) |
abstract void |
onStateChanged(ConnectState state,
java.lang.Object params)
Called when the connection state of the ATransport instance and the device changes.
|
abstract ResultCode |
removeAllStoreadData()
Deletes all data stored in the device.
|
void |
removeListener(IATEAReaderEventListener listener)
Removes the Listener that is listening for events on an instance of the ATEAReader class.
|
abstract ResultCode |
reset()
Reset the device.
|
void |
resetError()
Use only within the SDK.
|
abstract ResultCode |
saveStoredData(StoredDataList datas)
Store tag data or barcode data on the instrument.
|
void |
setAction(ActionState state)
ATEAReader Sets the operational state of the device associated with the instance.
|
void |
setAddress(java.lang.String address)
Sets the address of the device to which the instance of ATEAReader is connected.
|
abstract void |
setAlertNotify(NotifyMethod method)
Set the alert notify method for the device.
|
void |
setAutoConnect(boolean enabled)
Sets whether automatically connect to the device with the instance of the ATEAReader class.
|
abstract void |
setAutoOffTime(int time)
Sets the time at which the equipment automatically turns off.
|
abstract void |
setButtonNotify(NotifyMethod method)
Set the button Notify method of the device.
|
abstract void |
setButtonNotifyTime(NotifyTimeType time)
Set the button's Notify hold time.
|
abstract void |
setBuzzer(BuzzerState state)
Sets the buzzer operation status of the equipment.
|
void |
setCheckInterval(int interval)
Sets the time period for checking the battery status of the device associated with the ATEAReader class instance.
|
void |
setDeviceName(java.lang.String name)
Sets the name of the device to which the instance of ATEAReader is connected.
|
void |
setDeviceType(DeviceType type)
Sets the type of device to which instance of ATEAReader will be connected.
|
void |
setForceBatteryGauging(boolean enabled)
Sets whether check battery status of the device during action associated with the ATEAReader class instance.
|
void |
setLastError(ResultCode code)
Use only within the SDK.
|
abstract void |
setOperationMode(OperationMode mode)
Sets the current operating mode of the instrument.
|
abstract void |
setSerialNo(java.lang.String serialNo)
Set the serial number of the device.
|
abstract void |
setTime(java.util.Date time)
Sets the system time of the instrument.
|
abstract 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.
|
java.lang.String |
toString() |
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.
|
protected static final int INFO
protected static final int RETRY_COUNT
protected static final int DEFALT_BATTERY_CHECK_INTERVAL
protected java.lang.String TAG
protected ATransport mTransport
protected com.atid.lib.reader.device.ATDevice mDevice
protected ATRfidUhf mRfidUhf
protected com.atid.lib.module.rfid.hf.ATRfidHf mRfidHf
protected ATBarcode mBarcode
protected volatile ActionState mAction
protected com.atid.lib.util.Version mDeviceVersion
protected ResultCode mLastError
protected volatile int mCheckBatteryInterval
protected volatile boolean mIsForceBatteryGauging
protected volatile int mFailCount
protected volatile long mLastTime
protected volatile boolean mIsDisconnecting
public ATEAReader(ATransport transport)
transport
- ATEAReader An instance of an inherited class of the ATransport class that defines how an instance is associated with a Device.public ATEAReader(int sessionId, ATransport transport)
sessionId
- A unique ID number for identifying instances to manage multiple instances.transport
- ATEAReader An instance of an inherited class of the ATransport class that defines how an instance is associated with a Device.protected ConnectState getBackupState()
public int getSessionId()
public ATransport getTransport()
public DeviceType getDeviceType()
getDeviceType
in interface com.atid.lib.device.IReader
public void setDeviceType(DeviceType type)
setDeviceType
in interface com.atid.lib.device.IReader
type
- The DeviceType enumeration indicating the type of device.public java.lang.String getDeviceName()
getDeviceName
in interface com.atid.lib.device.IReader
public void setDeviceName(java.lang.String name)
setDeviceName
in interface com.atid.lib.device.IReader
name
- A string representing the name of the Device.public java.lang.String getAddress()
getAddress
in interface com.atid.lib.device.IReader
public void setAddress(java.lang.String address)
setAddress
in interface com.atid.lib.device.IReader
address
- A string representing the address of the Device.public ConnectType getConnectType()
public ConnectState getState()
public void setAutoConnect(boolean enabled)
enabled
- A boolean specifying whether the device automatically connect.public boolean getAutoConnect()
public boolean getDeviceAttached()
public java.lang.String getVersion()
getVersion
in interface com.atid.lib.device.IReader
public int getVersionHexa()
getVersionHexa
in interface com.atid.lib.device.IReader
public int getFullVersionHexa()
getFullVersionHexa
in interface com.atid.lib.device.IReader
public ActionState getAction()
getAction
in interface com.atid.lib.device.IReader
public void setAction(ActionState state)
setAction
in interface com.atid.lib.device.IReader
state
- An ActionState enumeration indicating the state of the action.public int getCheckInterval()
public void setCheckInterval(int interval)
interval
- Integer type indicating the battery check cycle time of the equipment. The unit is ms.public void setForceBatteryGauging(boolean enabled)
enabled
- A boolean specifying whether battery check cycle during device action ( ex) rfid inventory ).public void checkError()
com.atid.lib.device.IReader
checkError
in interface com.atid.lib.device.IReader
public void resetError()
com.atid.lib.device.IReader
resetError
in interface com.atid.lib.device.IReader
public ResultCode getLastError()
com.atid.lib.device.IReader
getLastError
in interface com.atid.lib.device.IReader
public void setLastError(ResultCode code)
com.atid.lib.device.IReader
setLastError
in interface com.atid.lib.device.IReader
public com.atid.lib.protocol.IProtocol getProtocol()
com.atid.lib.device.IReader
getProtocol
in interface com.atid.lib.device.IReader
public ATRfidUhf getRfidUhf()
public com.atid.lib.module.rfid.hf.ATRfidHf getRfidHf()
public ATBarcode getBarcode()
public void destroy()
public void wakeUp()
public void wakeUp(IATEAReaderEventListener listener)
listener
- An instance of IATEAReaderEventListener to receive events when an instance of ATEAReader is woken up.public void sleep()
public void sleep(IATEAReaderEventListener listener)
listener
- An instance of IATEAReaderEventListener to unblock events when an instance of ATEAReader is sleeping.protected boolean isEmptyRef()
public void addListener(IATEAReaderEventListener listener)
listener
- An instance of IATEAReaderEventListener to receive events fired by instances of the ATEAReader class.public void removeListener(IATEAReaderEventListener listener)
listener
- An instance of IATEAReaderEventListener that is receiving events fired by instances of the ATEAReader class.public void clearListener()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean connect()
public void listen()
public void disconnect()
public abstract boolean initReader()
public abstract ResultCode reset()
public abstract ResultCode defaultParameter()
public abstract ResultCode loadStoredData()
public abstract ResultCode saveStoredData(StoredDataList datas)
datas
- An instance of StoredDataList that maintains a list of data to store.public abstract ResultCode removeAllStoreadData()
public abstract OperationMode getOperationMode() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setOperationMode(OperationMode mode) throws ATException
mode
- An OperationMode enum indicating the operating mode of the device.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract BuzzerState getBuzzer() throws ATException
ATException
- Sets or returns the data for the equipment fails, the data poked ATException exception occurs.public abstract void setBuzzer(BuzzerState state) throws ATException
state
- To specify the status of the buzzer BuzzerState enumeration.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract boolean getUseActionKey() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setUseActionKey(boolean enabled) throws ATException
enabled
- A boolean specifying whether to use the trigger button.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract int getBatteryState() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract int getAutoOffTime() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setAutoOffTime(int time) throws ATException
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.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract java.util.Date getTime() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setTime(java.util.Date time) throws ATException
time
- An instance of Date representing the current date and time on the device.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public java.lang.String getSerialNo() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setSerialNo(java.lang.String serialNo) throws ATException
serialNo
- A string representing the serial number of the device.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract int getStoredTagCount() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract NotifyTimeType getButtonNotifyTime() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setButtonNotifyTime(NotifyTimeType time) throws ATException
time
- A NotifyTimeType enumeration that specifies the duration of the button's Notify retention.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract NotifyMethod getButtonNotify() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setButtonNotify(NotifyMethod method) throws ATException
method
- The NotifyMethod enumeration that specifies the button Notify method.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract NotifyMethod getAlertNotify() throws ATException
ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void setAlertNotify(NotifyMethod method) throws ATException
method
- Warning The NotifyMethod enumeration that specifies the Notify method.ATException
- An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.public abstract void onStateChanged(ConnectState state, java.lang.Object params)
ATransport.IConnectStateEventListener
onStateChanged
in interface ATransport.IConnectStateEventListener
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.protected void onReaderStateChanged(ConnectState state, java.lang.Object params)
protected void onReaderActionChanged(ResultCode code, ActionState action, java.lang.Object params)
protected void onReaderOperationModeChanged(OperationMode mode, java.lang.Object params)
protected void onReaderBatteryState(int batteryState, java.lang.Object params)
protected void onReaderKeyChanged(KeyType type, KeyState state, java.lang.Object params)
protected void onReaderUsbChargerChanged(UsbChargerType type, UsbChargerState state, java.lang.Object params)
protected void onReaderNotificationState(NotificationState state, java.lang.Object params)