public class

RfidManager

extends Object
java.lang.Object
   ↳ com.datalogic.device.rfid.RfidManager

Class Overview

RFIDManager gives developers access to RFID-related functionalities of the device.

To manage RFID inventory sessions with this class, use the following steps:

  1. Obtain an instance of RfidManager with RfidManager();
  2. Register the listeners needed in your application from the available ones: RFIDStartListener, RFIDReadListener, RFIDStopListener, and RFIDTimeoutListener;
  3. To begin an RFID reading session, call startInventory(). Your registered RFIDStartListener/RFIDReadListener/RFIDTimeoutListener will be called when a successful read occurs or if the configured timeout expires, etc;
  4. Call stopInventory() to end the reading session;

Summary

Public Constructors
RfidManager()
Constructs an RfidManager instance and initializes the connection with the underlying RFID system service.
Public Methods
int addReadListener(RfidReadListener listener)
Registers a RfidReadListener to be notified when a read event is triggered.
int addStartListener(RfidStartListener listener)
Registers a RfidStartListener to be notified when a inventory started event is triggered.
int addStopListener(RfidStopListener listener)
Registers a RfidStopListener to be notified when a inventory stopped event is triggered.
int addTimeoutListener(RfidTimeoutListener listener)
Registers a RfidTimeoutListener to be notified when a inventory timeout event is triggered.
int kill(RfidFilter filter, RfidPassword password)
Disables the RFID tag if it matches the filter and has the correct password.
int lock(RfidFilter filter, RfidPassword password, RfidLockObject object, RfidLockType type)
Locks or unlocks specified objects on an RFID tag based on the provided filter and password.
int lockU9(RfidFilter filter, RfidPassword password)
Locks RFID UCODE9 tag based on the provided filter and password.
int read(RfidFilter filter, RfidPassword password, RfidMemoryBankRegion bank, int address, int length, byte[] data)
Reads data from a specified memory bank of an RFID tag.
int removeReadListener(RfidReadListener listener)
Unregisters a RfidReadListener associated with the reader.
int removeStartListener(RfidStartListener listener)
Unregisters a RfidStartListener associated with the reader.
int removeStopListener(RfidStopListener listener)
Unregisters a RfidStopListener associated with the reader.
int removeTimeoutListener(RfidTimeoutListener listener)
Unregisters a RfidTimeoutListener associated with the reader.
int startInventory()
Call this method to start an RFID inventory operation.
int stopInventory()
Call this method to stop an ongoing RFID inventory operation.
int write(RfidFilter filter, RfidPassword password, RfidMemoryBankRegion bank, int address, byte[] data)
Writes data to a specified memory bank of an RFID tag.
int writeEPC(RfidPassword password, byte[] data)
Writes data to the EPC memory bank of an RFID tag, only one RFID Tag must be in the writing area.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RfidManager ()

Added in revision 50

Constructs an RfidManager instance and initializes the connection with the underlying RFID system service.

Throws
RfidException If an error occurs during initialization of the RFID service, including service retrieval failure, unavailability, or unexpected runtime exceptions.
DeviceException If the RFID service is not available, returns a null reference, or the feature is not supported or not initialized.

Public Methods

public int addReadListener (RfidReadListener listener)

Added in revision 50

Registers a RfidReadListener to be notified when a read event is triggered. Call removeReadListener(RfidReadListener) before the application closes to properly shut down the listener.

Parameters
listener The RfidReadListener that will be called when a reader's read event is fired.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int addStartListener (RfidStartListener listener)

Added in revision 50

Registers a RfidStartListener to be notified when a inventory started event is triggered. Call removeStartListener(RfidStartListener) before the application closes to properly shut down the listener.

Parameters
listener The RfidStartListener that will be called when a reader's started inventory event is fired.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int addStopListener (RfidStopListener listener)

Added in revision 50

Registers a RfidStopListener to be notified when a inventory stopped event is triggered. Call removeStopListener(RfidStopListener) before the application closes to properly shut down the listener.

Parameters
listener The RfidStopListener that will be called when a reader's stopped inventory event is fired.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int addTimeoutListener (RfidTimeoutListener listener)

Added in revision 50

Registers a RfidTimeoutListener to be notified when a inventory timeout event is triggered. Call removeTimeoutListener(RfidTimeoutListener) before the application closes to properly shut down the listener.

Parameters
listener The RfidTimeoutListener that will be called when a reader's inventory timeout event is fired.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int kill (RfidFilter filter, RfidPassword password)

Added in revision 50

Disables the RFID tag if it matches the filter and has the correct password.

Parameters
filter The RfidFilter used to select on which RFID tag to apply the operation.
password The RfidPassword that demonstrates the operation is authorized on the tag. If null, a default password of 4 bytes with value 0x00 is used.
Returns
  • int SUCCESS in case of success, otherwise an error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int lock (RfidFilter filter, RfidPassword password, RfidLockObject object, RfidLockType type)

Added in revision 50

Locks or unlocks specified objects on an RFID tag based on the provided filter and password.

Parameters
filter The RfidFilter used to select on which RFID tag to apply the operation.
password The RfidPassword that demonstrates the operation is authorized on the tag. If null, a default password of 4 bytes with value 0x00 is used.
object The RfidLockObject enum used to select which objects to lock.
type The RfidLockType enum that defines how each object must be locked or unlocked.
Returns
  • int SUCCESS in case of success, otherwise an error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int lockU9 (RfidFilter filter, RfidPassword password)

Added in revision 50

Locks RFID UCODE9 tag based on the provided filter and password.

Parameters
filter The RfidFilter used to select on which RFID tag to apply the operation.
password The RfidPassword that demonstrates the operation is authorized on the tag. If null, a default password of 4 bytes with value 0x00 is used.
Returns
  • int SUCCESS in case of success, otherwise an error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int read (RfidFilter filter, RfidPassword password, RfidMemoryBankRegion bank, int address, int length, byte[] data)

Added in revision 50

Reads data from a specified memory bank of an RFID tag.

Parameters
filter The RfidFilter used to select which RFID tag to apply the operation to. If null, no filtering is applied and the operation targets any tag in range.
password The RfidPassword that authorizes the read operation on the tag. If null, a default password of 4 bytes with value 0x00 is used.
bank The RfidMemoryBankRegion from which the data must be read.
address The starting address within the memory bank.
length The number of words to read from the memory bank.
data The output buffer that will contain the data read from the tag. Its size must be at least two times the required length, because RFID operation are word-based.
Returns
  • int SUCCESS if the operation completes successfully, otherwise an error code defined in RfidException.
Throws
RfidException If an error occurs during the operation, and exceptions are enabled via the ErrorManager singleton.

public int removeReadListener (RfidReadListener listener)

Added in revision 50

Unregisters a RfidReadListener associated with the reader.

Parameters
listener The RfidReadListener that will be no more notified.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int removeStartListener (RfidStartListener listener)

Added in revision 50

Unregisters a RfidStartListener associated with the reader.

Parameters
listener The RfidStartListener that will be no more notified.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int removeStopListener (RfidStopListener listener)

Added in revision 50

Unregisters a RfidStopListener associated with the reader.

Parameters
listener The RfidStopListener that will be no more notified.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int removeTimeoutListener (RfidTimeoutListener listener)

Added in revision 50

Unregisters a RfidTimeoutListener associated with the reader.

Parameters
listener The RfidTimeoutListener that will be no more notified.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int startInventory ()

Added in revision 50

Call this method to start an RFID inventory operation.
The inventory process begins immediately upon invocation and continues until either:
- the configured timeout (if set via the Configuration Manager) expires, or
- the stopInventory() method is explicitly called.

Returns
  • int SUCCESS in case of success, otherwise an error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int stopInventory ()

Added in revision 50

Call this method to stop an ongoing RFID inventory operation.
This method can be used to manually terminate the inventory process before the configured timeout expires.
It is typically used in conjunction with startInventory() to control the duration of the inventory session.

Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int write (RfidFilter filter, RfidPassword password, RfidMemoryBankRegion bank, int address, byte[] data)

Added in revision 50

Writes data to a specified memory bank of an RFID tag.

Parameters
filter The RfidFilter used to select on which RFID tag to apply the operation. If null, no filtering is applied and the operation targets any tag in range.
password The RfidPassword that demonstrates the operation is authorized on the tag. If null, a default password of 4 bytes with value 0x00 is used.
bank The RfidMemoryBankRegion on which the data must be written.
address The address from which to start writing the data.
data The data to be written. The length of the data must be even, as RFID memory is word-addressable.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the RfidException error constants.
Throws
RfidException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int writeEPC (RfidPassword password, byte[] data)

Added in revision 50

Writes data to the EPC memory bank of an RFID tag, only one RFID Tag must be in the writing area.

Parameters
password The RfidPassword that authorizes the operation on the tag. If null, a default password of 4 bytes with value 0x00 is used.
data The EPC data to be written to the tag.
Returns
  • int SUCCESS if the operation completes successfully, otherwise an error code defined in RfidException.
Throws
RfidException If an error occurs during the operation, and exceptions are enabled via the ErrorManager singleton.