|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thingmagic.Reader
public abstract class Reader
The Reader class encapsulates a connection to a ThingMagic RFID
reader device and provides an interface to perform RFID operations
such as reading tags and writing tag IDs. Reads can be done on
demand, with the read(long)
method, or continuously in the
background with the startReading()
method. Background reads
notify a listener objects of tags that are read.
Methods which communicate with the reader can throw ReaderException
if the communication breaks down. Other reasons for throwing
ReaderException are documented in the individual methods.
Operations which take an argument for a tag to operate on may
optionally be passed a null argument. This lets the reader choose
what tag to use, but may not work if multiple tags are
present. This use is recommended only when exactly one tag is known
to be in range.
Nested Class Summary | |
---|---|
static class |
Reader.GpioPin
|
static class |
Reader.LicenseOperation
Class for License key operation |
static class |
Reader.LicenseOption
Enum values for License key operations |
static class |
Reader.ReaderFeaturesFlag
Reader features flag enum |
static class |
Reader.Region
RFID regulatory regions |
static class |
Reader.RegulatoryMode
Enums for Regulatory mode |
static class |
Reader.RegulatoryModulation
Enums for Regulatory modulation |
Field Summary | |
---|---|
java.util.Set<Reader.ReaderFeaturesFlag> |
featuresFlag
|
boolean |
fetchTagReads
|
boolean |
hasContinuousReadStarted
|
boolean |
isOffTimeAdded
|
boolean |
probeSettingPassed
|
static TransportListener |
simpleTransportListener
|
int |
subOffTime
|
long |
tagFetchTime
|
Method Summary | |
---|---|
void |
addReadAuthenticationListener(ReadAuthenticationListener listener)
Register a listener to be notified of asynchronous RFID authentication exceptions. |
void |
addReadExceptionListener(ReadExceptionListener listener)
Register a listener to be notified of asynchronous RFID read exceptions. |
void |
addReadListener(ReadListener listener)
Register a listener to be notified of asynchronous RFID read events. |
abstract void |
addStatsListener(StatsListener listener)
Register a listener to be notified about the read stats |
abstract void |
addStatusListener(StatusListener listener)
Register a listener to be notified about the read statistics |
abstract void |
addTransportListener(TransportListener listener)
Register a listener to be notified of message packets. |
abstract void |
connect()
Open the communication channel and initialize the session with the reader. |
static Reader |
create(java.lang.String uriString)
Return an instance of a Reader class that is associated with a RFID reader on a particular communication channel. |
abstract void |
destroy()
Shuts down the connection with the reader device. |
abstract java.lang.Object |
executeTagOp(TagOp tagOP,
TagFilter target)
execute a TagOp |
abstract void |
firmwareLoad(java.io.InputStream firmware)
Load a new firmware image into the device's nonvolatile memory. |
abstract void |
firmwareLoad(java.io.InputStream firmware,
FirmwareLoadOptions loadOptions)
Load a new firmware image into the device's nonvolatile memory. |
abstract Reader.GpioPin[] |
gpiGet()
Get the state of all of the reader's GPI pins. |
abstract void |
gpoSet(Reader.GpioPin[] state)
Set the state of some GPO pins. |
boolean |
isAntDetectEnabled(int[] antennaList)
Method to check antenna detection is supported or not |
abstract void |
killTag(TagFilter target,
TagAuthentication auth)
Kill a tag. |
void |
loadConfig(java.lang.String filePath)
Loads the reader configuration parameters from file and applies to module |
abstract void |
lockTag(TagFilter target,
TagLockAction lock)
Perform a lock or unlock operation on a tag. |
java.lang.Object |
paramGet(java.lang.String key)
Get the value of a Reader parameter. |
java.lang.String[] |
paramList()
Get a list of the parameters available |
void |
paramSet(java.lang.String key,
java.lang.Object value)
Set the value of a Reader parameter. |
abstract TagReadData[] |
read(long duration)
Read RFID tags for a fixed duration. |
abstract byte[] |
readTagMemBytes(TagFilter target,
int bank,
int address,
int count)
Read data from the memory bank of a tag. |
abstract short[] |
readTagMemWords(TagFilter target,
int bank,
int address,
int count)
Read data from the memory bank of a tag. |
abstract void |
reboot()
reboots the reader device. |
abstract void |
receiveAutonomousReading()
|
abstract void |
regionConfiguration(boolean LBTEnable,
int LBTThreshold,
boolean dwellTimeEnable,
int dwellTime)
|
void |
removeReadAuthenticationListener(ReadAuthenticationListener listener)
Remove a listener from the list of listeners notified of asynchronous RFID authentication events. |
void |
removeReadExceptionListener(ReadExceptionListener listener)
Remove a listener from the list of listeners notified of asynchronous RFID read events. |
void |
removeReadListener(ReadListener listener)
Remove an listener from the list of listeners notified of asynchronous RFID read events. |
abstract void |
removeStatsListener(StatsListener listener)
remove a listener from the list of listeners to be notified of read stats |
abstract void |
removeStatusListener(StatusListener listener)
remove a listener from the list of listeners to be notified of read statistics |
abstract void |
removeTransportListener(TransportListener listener)
Remove a listener from the list of listeners to be notified of message packets. |
void |
saveConfig(java.lang.String filePath)
Saves the current reader configuration parameters and its values to a file |
static void |
setSerialTransport(java.lang.String scheme,
ReaderFactory factory)
|
abstract void |
startReading()
Start reading RFID tags in the background. |
abstract boolean |
stopReading()
Stop reading RFID tags in the background. |
static int |
versionCompare(java.lang.String str1,
java.lang.String str2)
|
abstract void |
writeTag(TagFilter target,
TagData newID)
Write a new ID to a tag. |
abstract void |
writeTagMemBytes(TagFilter target,
int bank,
int address,
byte[] data)
Write data to the memory bank of a tag. |
abstract void |
writeTagMemWords(TagFilter target,
int bank,
int address,
short[] data)
Write data to the memory bank of a tag. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static TransportListener simpleTransportListener
public boolean hasContinuousReadStarted
public java.util.Set<Reader.ReaderFeaturesFlag> featuresFlag
public boolean isOffTimeAdded
public int subOffTime
public long tagFetchTime
public boolean fetchTagReads
public boolean probeSettingPassed
Method Detail |
---|
public static Reader create(java.lang.String uriString) throws ReaderException
uriString
- an identifier for the reader to connect to, with
a URI syntax. The scheme can be eapi for the embedded
module protocol, rql for the request query language, or
tmr to guess. The remainder of the URI identifies the
stream that the protocol will be spoken over, either a local host
serial port device or a TCP network port.
Examples include:
Reader
object connected to the specified device
ReaderException
- if reader initialization failedpublic abstract void receiveAutonomousReading()
public abstract void regionConfiguration(boolean LBTEnable, int LBTThreshold, boolean dwellTimeEnable, int dwellTime) throws ReaderException
ReaderException
public static void setSerialTransport(java.lang.String scheme, ReaderFactory factory) throws ReaderException
ReaderException
public abstract void connect() throws ReaderException
ReaderException
public void loadConfig(java.lang.String filePath) throws ReaderException
filePath
-
ReaderException
public void saveConfig(java.lang.String filePath) throws ReaderException
filePath
-
ReaderException
public abstract void destroy()
public abstract void reboot() throws ReaderException
ReaderException
public abstract TagReadData[] read(long duration) throws ReaderException
duration
- the time to spend reading tags, in milliseconds
ReaderException
TagReadData
public abstract byte[] readTagMemBytes(TagFilter target, int bank, int address, int count) throws ReaderException
target
- the tag to read from, or nullbank
- the tag memory bank to read fromaddress
- the byte address to start reading atcount
- the number of bytes to read
ReaderException
public abstract short[] readTagMemWords(TagFilter target, int bank, int address, int count) throws ReaderException
target
- the tag to read from, or nullbank
- the tag memory bank to read fromaddress
- the word address to start reading fromcount
- the number of words to read
ReaderException
public abstract void writeTagMemBytes(TagFilter target, int bank, int address, byte[] data) throws ReaderException
target
- the tag to write to, or nullbank
- the tag memory bank to write toaddress
- the byte address to start writing todata
- the bytes to write
ReaderException
public abstract void writeTagMemWords(TagFilter target, int bank, int address, short[] data) throws ReaderException
target
- the tag to read from, or nullbank
- the tag memory bank to write toaddress
- the word address to start writing todata
- the words to write
ReaderException
public abstract void writeTag(TagFilter target, TagData newID) throws ReaderException
target
- the tag to write to, or nullnewID
- the new tag ID to write
ReaderException
public abstract void lockTag(TagFilter target, TagLockAction lock) throws ReaderException
target
- the tag to lock, or nulllock
- the locking action to take.
ReaderException
public abstract void killTag(TagFilter target, TagAuthentication auth) throws ReaderException
target
- the tag kill, or nullauth
- the authentication needed to kill the tag
ReaderException
public void addReadListener(ReadListener listener)
listener
- the ReadListener to addpublic void removeReadListener(ReadListener listener)
listener
- the ReadListener to removepublic void addReadExceptionListener(ReadExceptionListener listener)
listener
- the ReadExceptionListener to addpublic void removeReadExceptionListener(ReadExceptionListener listener)
listener
- The ReadExceptionListener to removepublic void addReadAuthenticationListener(ReadAuthenticationListener listener)
listener
- the ReadAuthenticationListener to addpublic void removeReadAuthenticationListener(ReadAuthenticationListener listener)
listener
- The ReadAuthenticationListener to removepublic abstract void startReading()
addReadListener(com.thingmagic.ReadListener)
,
addReadExceptionListener(com.thingmagic.ReadExceptionListener)
public abstract boolean stopReading()
public abstract Reader.GpioPin[] gpiGet() throws ReaderException
ReaderException
public abstract void gpoSet(Reader.GpioPin[] state) throws ReaderException
state
- Array of GpioPin objects
ReaderException
public java.lang.String[] paramList()
Supported Parameters:
public abstract java.lang.Object executeTagOp(TagOp tagOP, TagFilter target) throws ReaderException
ReaderException
public java.lang.Object paramGet(java.lang.String key) throws ReaderException
key
- the parameter name
java.lang.IllegalArgumentException
- if the parameter does not exist
ReaderException
public void paramSet(java.lang.String key, java.lang.Object value) throws ReaderException
key
- the parameter namevalue
- value of the parameter, as an Object
java.lang.IllegalArgumentException
- if the parameter does not exist,
is read-only, or if the Object is the wrong type for the
parameter.
ReaderException
public abstract void firmwareLoad(java.io.InputStream firmware) throws ReaderException, java.io.IOException
firmware
- a data stream of the firmware contents
ReaderException
java.io.IOException
public abstract void firmwareLoad(java.io.InputStream firmware, FirmwareLoadOptions loadOptions) throws ReaderException, java.io.IOException
firmware
- a data stream of the firmware contents
ReaderException
java.io.IOException
public abstract void addTransportListener(TransportListener listener)
listener
- the TransportListener to addpublic abstract void removeTransportListener(TransportListener listener)
listener
- the TransportListener to addpublic abstract void addStatusListener(StatusListener listener)
listener
- - StatusLisenter to addpublic abstract void removeStatusListener(StatusListener listener)
listener
- - StatusListener to removepublic abstract void addStatsListener(StatsListener listener)
listener
- - StatsLisenter to addpublic abstract void removeStatsListener(StatsListener listener)
listener
- - StatsListener to removepublic static int versionCompare(java.lang.String str1, java.lang.String str2)
public boolean isAntDetectEnabled(int[] antennaList) throws ReaderException
antennaList
- - List of antennas
ReaderException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |