com.thingmagic
Class RqlReader

java.lang.Object
  extended by com.thingmagic.Reader
      extended by com.thingmagic.RqlReader

public class RqlReader
extends Reader

The RqlReader class is an implementation of a Reader object that communicates with a ThingMagic fixed RFID reader via the RQL network protocol.

Instances of the RQL class are created with the Reader.create() method with a 'rql' URI or a generic 'tmr' URI that references a network device.


Nested Class Summary
static class RqlReader.AntennaMode
          The device antenna mode, for use in the /reader/antennaMode
static class RqlReader.PowerMode
          The device power mode, for use in the /reader/powerMode parameter.
 
Nested classes/interfaces inherited from class com.thingmagic.Reader
Reader.GpioPin, Reader.LicenseOperation, Reader.LicenseOption, Reader.ReaderFeaturesFlag, Reader.Region, Reader.RegulatoryMode, Reader.RegulatoryModulation
 
Field Summary
 
Fields inherited from class com.thingmagic.Reader
featuresFlag, fetchTagReads, hasContinuousReadStarted, isOffTimeAdded, probeSettingPassed, simpleTransportListener, subOffTime, tagFetchTime
 
Method Summary
 void addStatsListener(StatsListener listener)
          Register a listener to be notified about the read stats
 void addStatusListener(StatusListener listener)
          Register a listener to be notified about the read statistics
 void addTransportListener(TransportListener listener)
          Register a listener to be notified of message packets.
 java.lang.String cmdGetParam(java.lang.String field)
          Get a value from the underlying RQL/device configuration table.
 void cmdSetParam(java.lang.String field, java.lang.String value)
          Set a value in the underlying RQL/device configuration table.
 void connect()
          Open the communication channel and initialize the session with the reader.
 void destroy()
          Shuts down the connection with the reader device.
 java.lang.Object executeTagOp(TagOp tagOP, TagFilter target)
          execute a TagOp
 void firmwareLoad(java.io.InputStream firmware)
          Load a new firmware image into the device's nonvolatile memory.
 void firmwareLoad(java.io.InputStream firmware, FirmwareLoadOptions loadOptions)
          Load a new firmware image into the device's nonvolatile memory.
 Reader.GpioPin[] gpiGet()
          Get the state of all of the reader's GPI pins.
 void gpoSet(Reader.GpioPin[] state)
          Set the state of some GPO pins.
 void killTag(TagFilter target, TagAuthentication auth)
          Kill a tag.
 void lockTag(TagFilter target, TagLockAction lock)
          Perform a lock or unlock operation on a tag.
 TagReadData[] read(long duration)
          Read RFID tags for a fixed duration.
 byte[] readTagMemBytes(TagFilter target, int bank, int address, int count)
          Read data from the memory bank of a tag.
 short[] readTagMemWords(TagFilter target, int bank, int address, int count)
          Read data from the memory bank of a tag.
 void reboot()
          reboots the reader device.
 void receiveAutonomousReading()
           
 void regionConfiguration(boolean lbtEnable, int lbtThreshold, boolean dwellTimeEnable, int dwellTime)
           
 void removeStatsListener(StatsListener listener)
          remove a listener from the list of listeners to be notified of read stats
 void removeStatusListener(StatusListener listener)
          remove a listener from the list of listeners to be notified of read statistics
 void removeTransportListener(TransportListener l)
          Remove a listener from the list of listeners to be notified of message packets.
 void startReading()
          Start reading RFID tags in the background.
 boolean stopReading()
          Stop reading RFID tags in the background.
 void webRequest(java.io.InputStream fwStr, FirmwareLoadOptions loadOptions)
           
 void writeTag(TagFilter oldID, TagData newID)
          Write a new ID to a tag.
 void writeTagMemBytes(TagFilter target, int bank, int address, byte[] data)
          Write data to the memory bank of a tag.
 void writeTagMemWords(TagFilter target, int bank, int address, short[] data)
          Write data to the memory bank of a tag.
 
Methods inherited from class com.thingmagic.Reader
addReadAuthenticationListener, addReadExceptionListener, addReadListener, create, isAntDetectEnabled, loadConfig, paramGet, paramList, paramSet, removeReadAuthenticationListener, removeReadExceptionListener, removeReadListener, saveConfig, setSerialTransport, versionCompare
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reboot

public void reboot()
Description copied from class: Reader
reboots the reader device.

Specified by:
reboot in class Reader

receiveAutonomousReading

public void receiveAutonomousReading()
Specified by:
receiveAutonomousReading in class Reader

regionConfiguration

public void regionConfiguration(boolean lbtEnable,
                                int lbtThreshold,
                                boolean dwellTimeEnable,
                                int dwellTime)
                         throws ReaderException
Specified by:
regionConfiguration in class Reader
Throws:
ReaderException

connect

public void connect()
             throws ReaderException
Description copied from class: Reader
Open the communication channel and initialize the session with the reader.

Specified by:
connect in class Reader
Throws:
ReaderException

startReading

public void startReading()
Start reading RFID tags in the background. The tags found will be passed to the registered read listeners, and any exceptions that occur during reading will be passed to the registered exception listeners. Reading will continue until stopReading() is called.

Specified by:
startReading in class Reader
See Also:
Reader.addReadListener(com.thingmagic.ReadListener), Reader.addReadExceptionListener(com.thingmagic.ReadExceptionListener)

stopReading

public boolean stopReading()
Description copied from class: Reader
Stop reading RFID tags in the background.

Specified by:
stopReading in class Reader
Returns:
stop reading success or failure

addTransportListener

public void addTransportListener(TransportListener listener)
Description copied from class: Reader
Register a listener to be notified of message packets.

Specified by:
addTransportListener in class Reader
Parameters:
listener - the TransportListener to add

removeTransportListener

public void removeTransportListener(TransportListener l)
Description copied from class: Reader
Remove a listener from the list of listeners to be notified of message packets.

Specified by:
removeTransportListener in class Reader
Parameters:
l - the TransportListener to add

addStatusListener

public void addStatusListener(StatusListener listener)
Description copied from class: Reader
Register a listener to be notified about the read statistics

Specified by:
addStatusListener in class Reader
Parameters:
listener - - StatusLisenter to add

removeStatusListener

public void removeStatusListener(StatusListener listener)
Description copied from class: Reader
remove a listener from the list of listeners to be notified of read statistics

Specified by:
removeStatusListener in class Reader
Parameters:
listener - - StatusListener to remove

addStatsListener

public void addStatsListener(StatsListener listener)
Description copied from class: Reader
Register a listener to be notified about the read stats

Specified by:
addStatsListener in class Reader
Parameters:
listener - - StatsLisenter to add

removeStatsListener

public void removeStatsListener(StatsListener listener)
Description copied from class: Reader
remove a listener from the list of listeners to be notified of read stats

Specified by:
removeStatsListener in class Reader
Parameters:
listener - - StatsListener to remove

cmdGetParam

public java.lang.String cmdGetParam(java.lang.String field)
                             throws ReaderException
Get a value from the underlying RQL/device configuration table.

Parameters:
field - the name of configuration field to look up
Returns:
the value of the field as a string
Throws:
ReaderException

cmdSetParam

public void cmdSetParam(java.lang.String field,
                        java.lang.String value)
                 throws ReaderException
Set a value in the underlying RQL/device configuration table.

Parameters:
field - The name of configuration field to set
value - The value of the configuration parameter.
Throws:
ReaderException

executeTagOp

public java.lang.Object executeTagOp(TagOp tagOP,
                                     TagFilter target)
                              throws ReaderException
Description copied from class: Reader
execute a TagOp

Specified by:
executeTagOp in class Reader
Throws:
ReaderException

destroy

public void destroy()
Description copied from class: Reader
Shuts down the connection with the reader device.

Specified by:
destroy in class Reader

read

public TagReadData[] read(long duration)
                   throws ReaderException
Description copied from class: Reader
Read RFID tags for a fixed duration.

Specified by:
read in class Reader
Parameters:
duration - the time to spend reading tags, in milliseconds
Returns:
the tags read
Throws:
ReaderException
See Also:
TagReadData

writeTag

public void writeTag(TagFilter oldID,
                     TagData newID)
              throws ReaderException
Description copied from class: Reader
Write a new ID to a tag.

Specified by:
writeTag in class Reader
Parameters:
oldID - the tag to write to, or null
newID - the new tag ID to write
Throws:
ReaderException

killTag

public void killTag(TagFilter target,
                    TagAuthentication auth)
             throws ReaderException
Description copied from class: Reader
Kill a tag. The first tag seen is killed.

Specified by:
killTag in class Reader
Parameters:
target - the tag kill, or null
auth - the authentication needed to kill the tag
Throws:
ReaderException

readTagMemBytes

public byte[] readTagMemBytes(TagFilter target,
                              int bank,
                              int address,
                              int count)
                       throws ReaderException
Description copied from class: Reader
Read data from the memory bank of a tag.

Specified by:
readTagMemBytes in class Reader
Parameters:
target - the tag to read from, or null
bank - the tag memory bank to read from
address - the byte address to start reading at
count - the number of bytes to read
Returns:
the bytes read
Throws:
ReaderException

readTagMemWords

public short[] readTagMemWords(TagFilter target,
                               int bank,
                               int address,
                               int count)
                        throws ReaderException
Description copied from class: Reader
Read data from the memory bank of a tag.

Specified by:
readTagMemWords in class Reader
Parameters:
target - the tag to read from, or null
bank - the tag memory bank to read from
address - the word address to start reading from
count - the number of words to read
Returns:
the words read
Throws:
ReaderException

writeTagMemBytes

public void writeTagMemBytes(TagFilter target,
                             int bank,
                             int address,
                             byte[] data)
                      throws ReaderException
Description copied from class: Reader
Write data to the memory bank of a tag.

Specified by:
writeTagMemBytes in class Reader
Parameters:
target - the tag to write to, or null
bank - the tag memory bank to write to
address - the byte address to start writing to
data - the bytes to write
Throws:
ReaderException

writeTagMemWords

public void writeTagMemWords(TagFilter target,
                             int bank,
                             int address,
                             short[] data)
                      throws ReaderException
Description copied from class: Reader
Write data to the memory bank of a tag.

Specified by:
writeTagMemWords in class Reader
Parameters:
target - the tag to read from, or null
bank - the tag memory bank to write to
address - the word address to start writing to
data - the words to write
Throws:
ReaderException

lockTag

public void lockTag(TagFilter target,
                    TagLockAction lock)
             throws ReaderException
Description copied from class: Reader
Perform a lock or unlock operation on a tag. The first tag seen is operated on - the singulation parameter may be used to control this. Note that a tag without an access password set may not accept a lock operation or remain locked.

Specified by:
lockTag in class Reader
Parameters:
target - the tag to lock, or null
lock - the locking action to take.
Throws:
ReaderException

firmwareLoad

public void firmwareLoad(java.io.InputStream firmware,
                         FirmwareLoadOptions loadOptions)
                  throws ReaderException,
                         java.io.IOException
Description copied from class: Reader
Load a new firmware image into the device's nonvolatile memory. This installs the given image data onto the device and restarts it with that image. The firmware must be of an appropriate type for the device. Interrupting this operation may damage the reader.

Specified by:
firmwareLoad in class Reader
Parameters:
firmware - a data stream of the firmware contents
Throws:
ReaderException
java.io.IOException

firmwareLoad

public void firmwareLoad(java.io.InputStream firmware)
                  throws java.io.IOException,
                         ReaderException
Description copied from class: Reader
Load a new firmware image into the device's nonvolatile memory. This installs the given image data onto the device and restarts it with that image. The firmware must be of an appropriate type for the device. Interrupting this operation may damage the reader.

Specified by:
firmwareLoad in class Reader
Parameters:
firmware - a data stream of the firmware contents
Throws:
java.io.IOException
ReaderException

webRequest

public void webRequest(java.io.InputStream fwStr,
                       FirmwareLoadOptions loadOptions)
                throws ReaderException,
                       java.io.IOException
Throws:
ReaderException
java.io.IOException

gpiGet

public Reader.GpioPin[] gpiGet()
                        throws ReaderException
Description copied from class: Reader
Get the state of all of the reader's GPI pins.

Specified by:
gpiGet in class Reader
Returns:
array of GpioPin objects representing the state of all input pins
Throws:
ReaderException

gpoSet

public void gpoSet(Reader.GpioPin[] state)
            throws ReaderException
Description copied from class: Reader
Set the state of some GPO pins.

Specified by:
gpoSet in class Reader
Parameters:
state - Array of GpioPin objects
Throws:
ReaderException