com.thingmagic
Class LLRPReader

java.lang.Object
  extended by com.thingmagic.Reader
      extended by com.thingmagic.LLRPReader
All Implemented Interfaces:
Logger

public class LLRPReader
extends Reader
implements Logger


Nested Class Summary
 class LLRPReader.MonitorKeepAlives
          MonitorKeepAlives task monitors keep-alive messages received from tmmpd Would throw connection lost exception if keep-alive is not received within 20 seconds.
static class LLRPReader.ReaderConfigParams
           
 
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
 boolean addAccessSpec(org.llrp.ltk.generated.parameters.AccessSpec accessSpec)
           
 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.
 void checkForAvailableReaderFeatures()
          This method will check whether the below features are supported by the reader or not.
static void configureLogging()
           
 void connect()
          Open the communication channel and initialize the session with the reader.
 void deleteROSpecs()
          Deleting all ROSpecs from the reader
 void destroy()
          Shuts down the connection with the reader device.
 void destroyConnection()
          This method is only for Query Application in Web UI.
 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.
 int getNumPlans()
           
 Gen2.Target getTarget(int targetValue)
           
 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.
 org.llrp.ltk.generated.custom.parameters.ThingMagicDenatranIAVCommandRequest initIAVCommandRequest(Gen2.Denatran.IAV tagOp)
           
 org.llrp.ltk.generated.custom.parameters.ThingMagicNXPCommandRequest initNXPCommandRequest()
           
 void initRadioPower()
          Initializing PowerMaximum & PowerMinimum
 void killTag(TagFilter target, TagAuthentication auth)
          Kill a tag.
 void lockTag(TagFilter target, TagLockAction lock)
          Perform a lock or unlock operation on a tag.
 void log(java.lang.String message)
           
static int[] parseValue(java.lang.String value)
           
 SerialReader.ReaderStats processCustomStats(SerialReader.ReaderStats statValues, org.llrp.ltk.generated.custom.parameters.CustomStatsValue customStats, boolean allStats)
           
 void queryStopReading()
          This method is only for Query Application in Web UI.
 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 listener)
          Remove a listener from the list of listeners to be notified of message packets.
 void setNumPlans(int numPlans)
           
 void startReading()
          Start reading RFID tags in the background.
 boolean stopReading()
          Stop reading RFID tags in the background.
 void stopROSpec(int ROSPEC_ID)
          stopping RO Spec
static int toSL900aTime(java.util.Calendar calendar)
           
 void webRequest(java.io.InputStream fwStr, FirmwareLoadOptions loadOptions)
           
 void writeTag(TagFilter target, 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

configureLogging

public static void configureLogging()

checkForAvailableReaderFeatures

public void checkForAvailableReaderFeatures()
This method will check whether the below features are supported by the reader or not. If respective feature is supported, the corresponding flag gets added to featuresFlag.


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

reboot

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

Specified by:
reboot in class Reader
Throws:
ReaderException

getTarget

public Gen2.Target getTarget(int targetValue)

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

initRadioPower

public void initRadioPower()
                    throws ReaderException
Initializing PowerMaximum & PowerMinimum

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

destroyConnection

public void destroyConnection()
This method is only for Query Application in Web UI. When Applet is stopped/destroyed, to make cleanup fast this method is used


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

deleteROSpecs

public void deleteROSpecs()
                   throws ReaderException
Deleting all ROSpecs from the reader

Throws:
ReaderException

getNumPlans

public int getNumPlans()

setNumPlans

public void setNumPlans(int numPlans)

initIAVCommandRequest

public org.llrp.ltk.generated.custom.parameters.ThingMagicDenatranIAVCommandRequest initIAVCommandRequest(Gen2.Denatran.IAV tagOp)
                                                                                                   throws ReaderException
Throws:
ReaderException

initNXPCommandRequest

public org.llrp.ltk.generated.custom.parameters.ThingMagicNXPCommandRequest initNXPCommandRequest()
                                                                                           throws ReaderException
Throws:
ReaderException

toSL900aTime

public static int toSL900aTime(java.util.Calendar calendar)
                        throws ReaderException
Throws:
ReaderException

parseValue

public static int[] parseValue(java.lang.String value)

addAccessSpec

public boolean addAccessSpec(org.llrp.ltk.generated.parameters.AccessSpec accessSpec)
                      throws ReaderException
Throws:
ReaderException

stopROSpec

public void stopROSpec(int ROSPEC_ID)
                throws ReaderException
stopping RO Spec

Parameters:
ROSPEC_ID -
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

writeTag

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

Specified by:
writeTag in class Reader
Parameters:
target - the tag to write to, or null
newID - the new tag ID 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

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

startReading

public void startReading()
Description copied from class: Reader
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

queryStopReading

public void queryStopReading()
This method is only for Query Application in Web UI. When Applet is stopped, to make cleanup fast this method is used


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

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

firmwareLoad

public void firmwareLoad(java.io.InputStream firmware)
                  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,
                         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

webRequest

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

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 listener)
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:
listener - 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

log

public void log(java.lang.String message)
Specified by:
log in interface Logger

processCustomStats

public SerialReader.ReaderStats processCustomStats(SerialReader.ReaderStats statValues,
                                                   org.llrp.ltk.generated.custom.parameters.CustomStatsValue customStats,
                                                   boolean allStats)