public class ImpinjReader extends java.lang.Object implements org.llrp.ltk.net.LLRPEndpoint, KeepaliveTimeoutListener
Modifier and Type | Class and Description |
---|---|
protected class |
ImpinjReader.MessageHandler |
Constructor and Description |
---|
ImpinjReader()
Creates and initializes an ImpinjReader object.
|
ImpinjReader(java.lang.String address,
java.lang.String name)
Creates and initializes an ImpinjReader object.
|
ImpinjReader(java.lang.String address,
java.lang.String name,
int timeoutMs)
Creates and initializes an ImpinjReader object.
|
Modifier and Type | Method and Description |
---|---|
void |
addOpSequence(TagOpSequence sequence)
Adds a sequence of tag operations to the reader to perform during inventory
|
void |
applyDefaultSettings()
Applies the default settings to the reader.
|
void |
applySettings(org.llrp.ltk.generated.messages.SET_READER_CONFIG setReaderConfigMessage,
org.llrp.ltk.generated.messages.ADD_ROSPEC addROSpecMessage)
Applies the provided settings to the reader.
|
void |
applySettings(Settings settings)
Applies the provided settings to the reader.
|
void |
applySettingsWithoutFactoryReset(org.llrp.ltk.generated.messages.SET_READER_CONFIG setReaderConfigMessage,
org.llrp.ltk.generated.messages.ADD_ROSPEC addROSpecMessage)
Applies the provided settings to the reader, without doing a factory reset first.
|
void |
applySettingsWithoutFactoryReset(Settings settings)
Applies the provided settings to the reader, without doing a factory reset first.
|
org.llrp.ltk.generated.messages.ADD_ROSPEC |
buildAddROSpecMessage(Settings config)
Build up an LTK add ROSpec message.
|
org.llrp.ltk.generated.messages.SET_READER_CONFIG |
buildSetReaderConfigMessage(Settings config)
Build up an LTK set reader config message.
|
void |
connect()
Connect (unsecured) to an Impinj RFID reader using the default LLRP port (5084).
|
void |
connect(java.lang.String address)
Connect (unsecured) to an Impinj RFID reader using the default LLRP port (5084).
|
void |
connect(java.lang.String address,
boolean useTLS)
Connect to an Impinj RFID reader using the default LLRP port (5084).
|
void |
connect(java.lang.String address,
int port)
Connect (unsecured) to an Impinj RFID reader.
|
void |
connect(java.lang.String address,
int port,
boolean useTLS)
Connect to an Impinj RFID reader.
|
void |
deleteAllOpSequences()
Deletes all tag operation sequences from the reader
|
void |
deleteOpSequence(int sequenceId)
Deletes a tag operation sequence
|
void |
disconnect()
Disconnects the LLRP connection to the reader
|
void |
enableOpSequence(int sequenceId)
Enables the Tag Operation Sequence
|
void |
errorOccured(java.lang.String arg0) |
org.llrp.ltk.generated.messages.GET_ACCESSSPECS_RESPONSE |
getAccessSpec()
Get the Access Spec for checking reader configuration
|
java.lang.String |
getAddress()
Gest the IP address or hostname of the reader.
|
AntennaChangeListener |
getAntennaChangeListener() |
BufferOverflowListener |
getBufferOverflowListener() |
BufferWarningListener |
getBufferWarningListener() |
ConnectionAttemptListener |
getConnectionAttemptListener() |
ConnectionCloseListener |
getConnectionCloseListener() |
ConnectionLostListener |
getConnectionLostListener() |
int |
getConnectTimeout() |
DiagnosticsReportListener |
getDiagnosticsReportedListener() |
GpiChangeListener |
getGpiChangeListener() |
KeepaliveListener |
getKeepaliveListener() |
LocationReportListener |
getLocationReportedListener() |
int |
getMessageTimeout() |
java.lang.String |
getName()
Gets the name assigned to a reader
|
ReaderStartListener |
getReaderStartListener() |
ReaderStopListener |
getReaderStopListener() |
TagOpCompleteListener |
getTagOpCompleteListener() |
TagReportListener |
getTagReportListener() |
boolean |
isConnected() |
boolean |
isSpatialReader()
Detects if the connected reader is a reader with direction or location role capabilities (xArray or xSpan).
|
boolean |
isXArray()
Detects if the connected reader is an xArray.
|
boolean |
isXSpan()
Detects if the connected reader is an xSpan.
|
void |
messageReceived(org.llrp.ltk.types.LLRPMessage message)
For internal use only to receive messages from the LLRP library
|
void |
onKeepaliveTimeout() |
Settings |
queryDefaultSettings()
Queries the default settings of the reader.
|
FeatureSet |
queryFeatureSet()
Queries the reader for a summary of the features that it supports.
|
Settings |
querySettings()
This function queries the reader for its current settings.
|
Status |
queryStatus()
queries status information from the reader
|
void |
queryTags()
Tells the reader to send all the tag reports it has buffered.
|
boolean |
readerIsXArray()
Deprecated.
|
void |
removeAntennaChangeListener()
Removes the antenna change listener.
|
void |
removeDiagnosticsReportListener()
Removes the diagnostic report listener.
|
void |
removeDirectionReportListener()
Removes the direction report listener.
|
void |
removeGpiChangeListener()
Removes the GPI change listener.
|
void |
removeLocationReportListener()
Removes the location report listener.
|
void |
removeTagOpCompleteListener()
Removes the tag operation listener.
|
void |
removeTagReportListener()
Removes the tag report listener.
|
void |
resumeEventsAndReports()
This function tells the reader to resume sending reports and events.
|
void |
saveSettings()
Saves the settings object to a file in json format.
|
void |
setAddress(java.lang.String address)
Sets the IP address or hostname of the reader.
|
void |
setAntennaChangeListener(AntennaChangeListener antennaChangeListener)
The antenna change listener allows
the application to receive antenna change reports from the reader
|
void |
setBufferOverflowListener(BufferOverflowListener bufferOverflowListener)
The buffer overflow listener allows the application to receive a
notification when the buffer in the reader has overflowed and
tag reports and events may be getting lost
|
void |
setBufferWarningListener(BufferWarningListener bufferWarningListener)
The buffer warning listener allows the application to receive a
notification when the buffer has filled to TBD level.
|
void |
setConnectionAttemptListener(ConnectionAttemptListener connectionAttemptListener)
The connection attempt listener allows the application to receive
a notification when other applications are trying to connect to the
reader.
|
void |
setConnectionCloseListener(ConnectionCloseListener connectionCloseListener)
The connection close listener allows the application to receive
a notification when the reader has closed the connection to the SDK
|
void |
setConnectionLostListener(ConnectionLostListener connectionLostListener)
The connection list listener allows
the application to receive a notification when the
keepalives have stopped and the connection is presumed lost.
|
void |
setConnectTimeout(int connectTimeoutMsec)
Set the connect timeout for all connection attempts with the reader.
|
void |
setDiagnosticsReportListener(DiagnosticsReportListener diagnosticsReportListener)
Sets the diagnostic report listener.
|
void |
setDirectionReportListener(DirectionReportListener directionReportListener)
Set the direction report listener.
|
void |
setGpiChangeListener(GpiChangeListener gpiChangeListener)
The GPI change listener allows
the application to receive GPI change reports from the reader
|
void |
setGpo(int port,
boolean portState)
sets a GPO to specified state
|
void |
setKeepaliveListener(KeepaliveListener keepaliveListener)
The keepalive listener allows
the application to receive keepalive reports from the reader.
|
void |
setLocationReportListener(LocationReportListener locationReportListener)
Set the location report listener.
|
void |
setMessageTimeout(int messageTimeoutMsec) |
void |
setName(java.lang.String name)
Assigns a name to this reader.
|
void |
setReaderStartListener(ReaderStartListener readerStartListener)
The reader start listener allows the application to receive a
notification when the reader starts inventory
|
void |
setReaderStopListener(ReaderStopListener readerStopListener)
The reader stop listener allows the application to receive a
notification when the reader stops inventory
|
void |
setTagOpCompleteListener(TagOpCompleteListener tagOpCompleteListener)
Sets the tag operation listener for the reader.
|
void |
setTagReportListener(TagReportListener tagReportListener)
Sets the tag report listener.
|
void |
start()
Starts the reader.
|
void |
stop()
Stops the reader from its inventory.
|
java.lang.String |
toString() |
void |
turnBeaconOff()
Turns off the xArray beacon LED
|
void |
turnBeaconOn(long durationMsec)
Turns on the xArray Beacon LED.
|
public ImpinjReader(java.lang.String address, java.lang.String name, int timeoutMs)
address
- the IP address or hostname of the readername
- a name given to the readertimeoutMs
- the connection and message timeout for the readerpublic ImpinjReader(java.lang.String address, java.lang.String name)
address
- the IP address or hostname of the readername
- a name given to the readersetName(java.lang.String)
,
setAddress(java.lang.String)
public ImpinjReader()
@Deprecated public boolean readerIsXArray()
isXArray()
public boolean isXArray()
public boolean isXSpan()
public boolean isSpatialReader()
public int getMessageTimeout()
public void setMessageTimeout(int messageTimeoutMsec)
messageTimeoutMsec
- -- set the message timeout for all interactions
with the reader. If a message is sent to the reader and a response
is not received by messageTime milliseconds later, the SDK will throw
an exceptionpublic int getConnectTimeout()
public void setConnectTimeout(int connectTimeoutMsec)
connectTimeoutMsec
- The amount of time to wait (in ms) for a connection to be successfully established.public TagReportListener getTagReportListener()
public void setTagReportListener(TagReportListener tagReportListener)
tagReportListener
- the listener object to receive eventsTagReport
public void removeTagReportListener()
public TagOpCompleteListener getTagOpCompleteListener()
public void setTagOpCompleteListener(TagOpCompleteListener tagOpCompleteListener)
tagOpCompleteListener
- the listener object to receive eventsTagOpResult
,
TagOp
public void removeTagOpCompleteListener()
public LocationReportListener getLocationReportedListener()
public void setLocationReportListener(LocationReportListener locationReportListener)
locationReportListener
- the listener object to receive eventsLocationReport
public void removeLocationReportListener()
public void setDirectionReportListener(DirectionReportListener directionReportListener)
directionReportListener
- the DirectionReportListener implementation that will receive these eventsDirectionReport
public void removeDirectionReportListener()
public DiagnosticsReportListener getDiagnosticsReportedListener()
public void setDiagnosticsReportListener(DiagnosticsReportListener diagnosticsReportListener)
diagnosticsReportListener
- the listener object to receive eventsDiagnosticReport
public void removeDiagnosticsReportListener()
public GpiChangeListener getGpiChangeListener()
public void setGpiChangeListener(GpiChangeListener gpiChangeListener)
gpiChangeListener
- the listener object to receive eventsGpiEvent
public void removeGpiChangeListener()
public AntennaChangeListener getAntennaChangeListener()
public void setAntennaChangeListener(AntennaChangeListener antennaChangeListener)
antennaChangeListener
- the listener object to receive eventsAntennaEvent
public void removeAntennaChangeListener()
public KeepaliveListener getKeepaliveListener()
public void setKeepaliveListener(KeepaliveListener keepaliveListener)
keepaliveListener
- the listener object to receive eventsKeepaliveEvent
public ConnectionLostListener getConnectionLostListener()
public void setConnectionLostListener(ConnectionLostListener connectionLostListener)
connectionLostListener
- the listener to receive eventspublic ReaderStartListener getReaderStartListener()
public void setReaderStartListener(ReaderStartListener readerStartListener)
readerStartListener
- the listener object to receive eventsReaderStartEvent
public ReaderStopListener getReaderStopListener()
public void setReaderStopListener(ReaderStopListener readerStopListener)
readerStopListener
- the listener object to receive eventsReaderStopEvent
public BufferWarningListener getBufferWarningListener()
public void setBufferWarningListener(BufferWarningListener bufferWarningListener)
bufferWarningListener
- the listener object to receive eventsBufferWarningEvent
public BufferOverflowListener getBufferOverflowListener()
public void setBufferOverflowListener(BufferOverflowListener bufferOverflowListener)
bufferOverflowListener
- the listener object to receive eventsBufferOverflowEvent
public ConnectionAttemptListener getConnectionAttemptListener()
public void setConnectionAttemptListener(ConnectionAttemptListener connectionAttemptListener)
connectionAttemptListener
- the listener object to receive eventsConnectionAttemptEvent
public ConnectionCloseListener getConnectionCloseListener()
public void setConnectionCloseListener(ConnectionCloseListener connectionCloseListener)
connectionCloseListener
- the listener object to receive eventsConnectionCloseEvent
public void onKeepaliveTimeout()
onKeepaliveTimeout
in interface KeepaliveTimeoutListener
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to assign to this readerpublic java.lang.String getAddress()
public void setAddress(java.lang.String address)
address
- address or hostname string of the reader devicepublic java.lang.String toString()
toString
in class java.lang.Object
public void connect() throws OctaneSdkException
OctaneSdkException
- when the connection attempt fails or
if the Address property has not been set.public void connect(java.lang.String address) throws OctaneSdkException
address
- -- address or hostname of the readerOctaneSdkException
- if the connection attempt failspublic void connect(java.lang.String address, boolean useTLS) throws OctaneSdkException
address
- -- address or hostname of the readeruseTLS
- -- enable TLS encryption if "true"OctaneSdkException
- if the connection attempt failspublic void connect(java.lang.String address, int port) throws OctaneSdkException
address
- -- the address or hostname of the readerport
- -- the TCP port number of the LLRP serviceOctaneSdkException
- when the connection atttempt failspublic void connect(java.lang.String address, int port, boolean useTLS) throws OctaneSdkException
address
- -- the address or hostname of the readerport
- -- the TCP port number of the LLRP serviceuseTLS
- -- enable TLS encryption if "true"OctaneSdkException
- when the connection atttempt failspublic boolean isConnected()
public FeatureSet queryFeatureSet() throws OctaneSdkException
OctaneSdkException
- if the capabilities could not be discoveredpublic void disconnect()
public void stop() throws OctaneSdkException
OctaneSdkException
- if the reader cannot be stoppedpublic void start() throws OctaneSdkException
OctaneSdkException
- if the Start method is called before
connecting to a reader.TagReport
public void applyDefaultSettings() throws OctaneSdkException
OctaneSdkException
- if this method is called
prior to establishing a connection with a reader.public void applySettings(org.llrp.ltk.generated.messages.SET_READER_CONFIG setReaderConfigMessage, org.llrp.ltk.generated.messages.ADD_ROSPEC addROSpecMessage) throws OctaneSdkException
setReaderConfigMessage
- The set reader config LLRP LTK message to be sent.addROSpecMessage
- The add RO Spec LLRP LTK message to be sent.OctaneSdkException
- if this method is called prior to establishing a
connection with a reader, or if the settings are invalid.public void applySettingsWithoutFactoryReset(org.llrp.ltk.generated.messages.SET_READER_CONFIG setReaderConfigMessage, org.llrp.ltk.generated.messages.ADD_ROSPEC addROSpecMessage) throws OctaneSdkException
setReaderConfigMessage
- The set reader config LLRP LTK message to be sent.addROSpecMessage
- The add RO Spec LLRP LTK message to be sent.OctaneSdkException
- if this method is called prior to establishing a
connection with a reader, or if the settings are invalid.public void applySettings(Settings settings) throws OctaneSdkException
settings
- Settings to apply to the reader.OctaneSdkException
- if this method is called prior to establishing a
connection with a reader, or if the settings are invalid.public void applySettingsWithoutFactoryReset(Settings settings) throws OctaneSdkException
settings
- Settings to apply to the reader.OctaneSdkException
- if this method is called prior to establishing a
connection with a reader, or if the settings are invalid.public void saveSettings() throws OctaneSdkException
OctaneSdkException
- if the save failspublic org.llrp.ltk.generated.messages.ADD_ROSPEC buildAddROSpecMessage(Settings config) throws OctaneSdkException
config
- A settings object after which the message will be modeled.OctaneSdkException
- if an error was encountered while building the ROSpec message.public Settings queryDefaultSettings()
applySettings(Settings)
public org.llrp.ltk.generated.messages.SET_READER_CONFIG buildSetReaderConfigMessage(Settings config) throws OctaneSdkException
config
- A settings object after which the message will be modeled.OctaneSdkException
- if an error occurred while building the reader config message.public Settings querySettings() throws OctaneSdkException
OctaneSdkException
- if a communication error
occurs while talking with the reader, the reader has not
been configured, or if the configuration was not applied
by the SDKpublic void setGpo(int port, boolean portState) throws OctaneSdkException
port
- GPO port corresponding to the gpo to setportState
- the desired port stateOctaneSdkException
- if the command failspublic Status queryStatus() throws OctaneSdkException
OctaneSdkException
- if the command failspublic void turnBeaconOn(long durationMsec) throws OctaneSdkException
durationMsec
- length in time to enable the beaconOctaneSdkException
- if the command fails.public void turnBeaconOff() throws OctaneSdkException
OctaneSdkException
- if the beacon cannot be disabledpublic void errorOccured(java.lang.String arg0)
errorOccured
in interface org.llrp.ltk.net.LLRPEndpoint
arg0
- TODOpublic void messageReceived(org.llrp.ltk.types.LLRPMessage message)
messageReceived
in interface org.llrp.ltk.net.LLRPEndpoint
message
- the LLRP message received by the readerpublic void queryTags() throws OctaneSdkException
OctaneSdkException
- when this method is called prior to
establishing a connection with a reader.public void addOpSequence(TagOpSequence sequence) throws OctaneSdkException
sequence
- the sequence of operations to performOctaneSdkException
- if the sequence is invalid or could not be appliedpublic org.llrp.ltk.generated.messages.GET_ACCESSSPECS_RESPONSE getAccessSpec() throws OctaneSdkException
OctaneSdkException
- if the attempt to get the acess spec from the reader times out.public void enableOpSequence(int sequenceId) throws OctaneSdkException
sequenceId
- the ID of the sequence to be enabledOctaneSdkException
- if a communication error
occurs while talking with the reader.TagOpSequence
public void deleteOpSequence(int sequenceId) throws OctaneSdkException
sequenceId
- the ID of the sequence to be disabledOctaneSdkException
- if a communication error
occurs while talking with the reader.TagOpSequence
public void deleteAllOpSequences() throws OctaneSdkException
OctaneSdkException
- if the operation failsTagOpSequence
public void resumeEventsAndReports() throws OctaneSdkException
OctaneSdkException
- if a communication error
occurs while talking with the reader.