public abstract class RFIDReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
Q_MAX
Maximum starting Q parameter value that is used in the Gen2 protocol to read tags.
|
Constructor and Description |
---|
RFIDReader() |
Modifier and Type | Method and Description |
---|---|
abstract RFIDResult |
blockPermalock(java.lang.String accessPwd,
Mask mask,
int lock,
Mask blockMask)
This method implements the Gen2 BlockPermalock command
|
abstract void |
close()
Release resources when done using RFID module.
|
java.lang.String |
getAccessPwd()
Get the default global access password.
|
abstract boolean |
getAcqTID()
Get the state of TID acquisition during inventories (enabled or disabled).
|
java.util.Map<RFIDInfo,java.lang.String> |
getInfo()
Get all information about the Reader, RFID hardware and firmware versions.
|
abstract java.lang.String |
getInfo(RFIDInfo type)
Get information about the Reader, such as model, RFID hardware and firmware versions.
|
Mask |
getMask()
Get the default global mask.
|
abstract int |
getMaxPower()
Return maximum supported transmit power.
|
abstract int |
getMinPower()
Return minimum supported transmit power.
|
abstract int |
getPower()
Get RFID transmit power.
|
abstract int |
getQ()
Get starting Q parameter value that is used in the Gen2 protocol to read tags.
|
abstract SearchMode |
getSearchMode()
Get inventory search mode.
|
abstract Session |
getSession()
Get Gen2 session.
|
abstract Target |
getTarget()
Get inventory target.
|
abstract float |
getTemperature()
Get current temperature of the module or reader
|
void |
inventory(RFIDCallback callback)
This is the same as
inventory(RFIDCallback, Mask) , but uses the default mask (set by setMask(Mask) ). |
abstract void |
inventory(RFIDCallback callback,
Mask mask)
Start a continuous inventory.
|
abstract boolean |
isRunning()
Check if a continuous inventory is currently running.
|
RFIDResult |
kill(java.lang.String killPassword)
This method is the same as
kill(String, Mask) , but uses the default mask set by setMask(Mask) ). |
abstract RFIDResult |
kill(java.lang.String killPassword,
Mask mask)
Kill the RFID tag.
|
RFIDResult |
lock(LockFields fields,
LockType lockType)
This method is the same as
lock(LockFields, LockType, Mask, String) , but uses the default
mask (set by setMask(Mask) ) and default access password (set by setAccessPwd(String) ). |
RFIDResult |
lock(LockFields fields,
LockType lockType,
Mask mask)
This method is the same as
lock(LockFields, LockType, Mask, String) , but uses the default
access password (set by setAccessPwd(String) ). |
abstract RFIDResult |
lock(LockFields fields,
LockType lockType,
Mask mask,
java.lang.String accessPassword)
Lock, Unlock, PermaLock, or PermaUnlock tag's memory fields.
|
RFIDResult |
lock(LockFields fields,
LockType lockType,
java.lang.String accessPassword)
This method is the same as
lock(LockFields, LockType, Mask, String) , but uses the default
mask (set by setMask(Mask) ). |
RFIDResult |
read()
This method is the same as
read(Mask) , but uses the default mask (set by setMask(Mask) ). |
RFIDResult |
read(Bank bank,
int wordPointer,
int wordCount)
This method is the same as
read(Bank, int, int, Mask, String) , but uses the default
mask (set by setMask(Mask) ) and the default access password (set by
setAccessPwd(String) ). |
RFIDResult |
read(Bank bank,
int wordPointer,
int wordCount,
Mask mask)
This method is same as
read(Bank, int, int, Mask, String) , but uses the default access
password (set by setAccessPwd(String) ). |
abstract RFIDResult |
read(Bank bank,
int wordPointer,
int wordCount,
Mask mask,
java.lang.String accessPassword)
Reads data from a specific memory location of a tag.
|
RFIDResult |
read(Bank bank,
int wordPointer,
int wordCount,
java.lang.String accessPassword)
This method is the same as
read(Bank, int, int, Mask, String) , but uses the default
mask (set by setMask(Mask) ). |
abstract RFIDResult |
read(Mask mask)
Read a single RFID tag.
|
void |
setAccessPwd(java.lang.String accessPwd)
Set the default global access password.
|
abstract void |
setAcqTID(boolean enable)
Enable or disable TID acquisition during inventories.
|
void |
setMask(Mask mask)
Set the default global mask.
|
abstract void |
setPower(int power)
Set RFID transmit power.
|
abstract void |
setQ(int QValue)
Set the starting Q parameter value that is used in the Gen2 protocol to read tags.
|
abstract void |
setSearchMode(SearchMode mode)
Set inventory search mode.
|
abstract void |
setSession(Session session)
Set Gen2 session.
|
abstract void |
setTarget(Target target)
Set inventory target.
|
abstract void |
stop()
Stop the currently-running continuous inventory.
|
RFIDResult |
write(Bank bank,
int wordPointer,
java.lang.String data)
This method is the same as
write(Bank, int, String, Mask, String) , but uses the
default mask (set by setMask(Mask) ) and default access password (set by
setAccessPwd(String) ). |
RFIDResult |
write(Bank bank,
int wordPointer,
java.lang.String data,
Mask mask)
This method is the same as
write(Bank, int, String, Mask, String) , but uses the
default access password (set by setAccessPwd(String) ). |
abstract RFIDResult |
write(Bank bank,
int wordPointer,
java.lang.String data,
Mask mask,
java.lang.String accessPassword)
Writes the given data into a specific bank at a specific word offset within a tag's memory.
|
RFIDResult |
write(Bank bank,
int wordPointer,
java.lang.String data,
java.lang.String accessPassword)
This method is the same as
write(Bank, int, String, Mask, String) , but uses the
default mask (set by setMask(Mask) ). |
public static final int Q_MAX
public abstract void close()
public abstract java.lang.String getInfo(RFIDInfo type)
public java.util.Map<RFIDInfo,java.lang.String> getInfo()
public abstract int getPower() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is in the middle of a continuous inventorypublic abstract void setPower(int power) throws ReaderException
power
- RFID transmitting power in dBmReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)InvalidParamException
- if the power value is not validpublic abstract void setQ(int QValue) throws ReaderException
QValue
- the starting Q parameter value (0-15)ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)InvalidParamException
- if the QValue is not validpublic abstract int getQ() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract Session getSession() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void setSession(Session session) throws ReaderException
session
- The Gen2 protocol session to use when communicating with RFID tagsReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract Target getTarget() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void setTarget(Target target) throws ReaderException
target
- the Gen2 protocol inventory Target
(A or B) to use when inventorying tagsReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void setSearchMode(SearchMode mode) throws ReaderException
mode
- search mode SearchMode
to use during tag inventories (DUAL or SINGLE)ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract SearchMode getSearchMode() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public void setMask(Mask mask)
mask
- the new default Gen2 protocol maskpublic Mask getMask()
public void setAccessPwd(java.lang.String accessPwd)
accessPwd
- the new default access passwordpublic java.lang.String getAccessPwd()
public abstract boolean getAcqTID() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void setAcqTID(boolean enable) throws ReaderException
enable
- the TID enable flagReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract RFIDResult read(Mask mask) throws ReaderException
mask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
RFIDResult.isSuccess()
will return true and RFIDResult.getData()
will return the Tag object.ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult read() throws ReaderException
read(Mask)
, but uses the default mask (set by setMask(Mask)
).RFIDResult.isSuccess()
will return true and RFIDResult.getData()
will return the Tag object.ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void inventory(RFIDCallback callback, Mask mask) throws ReaderException
isRunning()
to check if the continue inventory is running. Call stop()
to stop the continuous
inventory thread.
NOTE: The reader cannot respond to other commands during a continuous
inventory. It is necessary to stop the continuous inventory using stop()
before running other commands. If another command is sent while a continuous inventory is
running, an RFIDBusyException
is raised for that command.
callback
- The callback to use for retrieving tag informationmask
- The Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public void inventory(RFIDCallback callback) throws ReaderException
inventory(RFIDCallback, Mask)
, but uses the default mask (set by setMask(Mask)
).callback
- The tag information is retrieved via this callbackReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract void stop() throws ReaderException
ReaderException
- if there is errorpublic abstract boolean isRunning()
public abstract RFIDResult kill(java.lang.String killPassword, Mask mask) throws ReaderException
killPassword
- kill password (must be non-zero)mask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
RFIDResult.isSuccess()
will return true if the tag was killedReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult kill(java.lang.String killPassword) throws ReaderException
kill(String, Mask)
, but uses the default mask set by setMask(Mask)
).killPassword
- kill password (must be non-zero)RFIDResult.isSuccess()
will return true if the tag was killedReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract RFIDResult read(Bank bank, int wordPointer, int wordCount, Mask mask, java.lang.String accessPassword) throws ReaderException
bank
- the Gen2 memory bank to read fromwordPointer
- pointer (in word units) to the memory location within the bankwordCount
- the number of words to readmask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
accessPassword
- The access password used when accessing protected tag memoryRFIDResult.isSuccess()
will return true and RFIDResult.getData()
will contain the data.ReaderException
- if there is errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult read(Bank bank, int wordPointer, int wordCount, Mask mask) throws ReaderException
read(Bank, int, int, Mask, String)
, but uses the default access
password (set by setAccessPwd(String)
). The pointer, and count values are all in word units.bank
- the Gen2 memory bank to read fromwordPointer
- pointer (in word units) to the memory location within the bankwordCount
- the number of words to readmask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
RFIDResult.isSuccess()
will return true and RFIDResult.getData()
will contain the data.ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult read(Bank bank, int wordPointer, int wordCount, java.lang.String accessPassword) throws ReaderException
read(Bank, int, int, Mask, String)
, but uses the default
mask (set by setMask(Mask)
). The pointer, and count values are all in word units.bank
- the Gen2 memory bank to read fromwordPointer
- pointer (in word units) to the memory location within the bankwordCount
- the number of words to readaccessPassword
- The access password used when accessing protected tag memoryRFIDResult.isSuccess()
will return true and RFIDResult.getData()
will contain the data.ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult read(Bank bank, int wordPointer, int wordCount) throws ReaderException
read(Bank, int, int, Mask, String)
, but uses the default
mask (set by setMask(Mask)
) and the default access password (set by
setAccessPwd(String)
). The pointer, and count values are all in word units.bank
- the Gen2 memory bank to read fromwordPointer
- pointer (in word units) to the memory location within the bankwordCount
- the number of words to readRFIDResult.isSuccess()
will return true and RFIDResult.getData()
will contain the data.ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract RFIDResult write(Bank bank, int wordPointer, java.lang.String data, Mask mask, java.lang.String accessPassword) throws ReaderException
bank
- the Gen2 memory bank to write towordPointer
- pointer (in word units) to the memory location within the bankdata
- data to be written (in word units)mask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
accessPassword
- The access password used when accessing protected tag memoryRFIDResult.isSuccess()
will return true if the data was successfully written to the tagReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult write(Bank bank, int wordPointer, java.lang.String data, Mask mask) throws ReaderException
write(Bank, int, String, Mask, String)
, but uses the
default access password (set by setAccessPwd(String)
). The pointer value is in word units.bank
- the Gen2 memory bank to write towordPointer
- pointer (in word units) to the memory location within the bankdata
- data to be written (in word units)mask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
RFIDResult.isSuccess()
will return true if the data was successfully written to the tagReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult write(Bank bank, int wordPointer, java.lang.String data, java.lang.String accessPassword) throws ReaderException
write(Bank, int, String, Mask, String)
, but uses the
default mask (set by setMask(Mask)
). The pointer value is in word units.bank
- the Gen2 memory bank to write towordPointer
- pointer (in word units) to the memory location within the bankdata
- data to be written (in word units)accessPassword
- access password to be used when accessing protected tag memoryRFIDResult.isSuccess()
will return true if the data was successfully written to the tagReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult write(Bank bank, int wordPointer, java.lang.String data) throws ReaderException
write(Bank, int, String, Mask, String)
, but uses the
default mask (set by setMask(Mask)
) and default access password (set by
setAccessPwd(String)
). The pointer value is in word units.bank
- the Gen2 memory bank to write towordPointer
- pointer (in word units) to the memory location within the bankdata
- data to be writtenRFIDResult.isSuccess()
will return true if the data was successfully written to the tagReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract RFIDResult lock(LockFields fields, LockType lockType, Mask mask, java.lang.String accessPassword) throws ReaderException
fields
- a bitmap of memory fields to be locked. Multiple memory fields can be specified using the '|' operation.lockType
- the type of lock operation to be performedmask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
accessPassword
- the access password to be used when accessing protected tag memoryRFIDResult.isSuccess()
will return true if the lock operation was successfulReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult lock(LockFields fields, LockType lockType, Mask mask) throws ReaderException
lock(LockFields, LockType, Mask, String)
, but uses the default
access password (set by setAccessPwd(String)
).fields
- a bitmap of memory fields to lock. Multiple memory fields can be specified using the '|' operation.lockType
- the type of lock operation to be performedmask
- the Gen2 protocol mask. The reader will apply this mask to match only specific tags. To disable tag masking use Mask.NONE
RFIDResult.isSuccess()
will return true if the lock operation was successfulReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult lock(LockFields fields, LockType lockType, java.lang.String accessPassword) throws ReaderException
lock(LockFields, LockType, Mask, String)
, but uses the default
mask (set by setMask(Mask)
).fields
- a bitmap of memory fields to lock. Multiple memory fields can be specified using the '|' operation.lockType
- the type of lock operation to be performedaccessPassword
- the access password to be used when accessing protected tag memoryRFIDResult.isSuccess()
will return true if the lock operation was successfulReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public RFIDResult lock(LockFields fields, LockType lockType) throws ReaderException
lock(LockFields, LockType, Mask, String)
, but uses the default
mask (set by setMask(Mask)
) and default access password (set by setAccessPwd(String)
).fields
- a bitmap of memory fields to lock. Multiple memory fields can be specified using the '|' operation.lockType
- the type of lock operation to be performedRFIDResult.isSuccess()
will return true if the lock operation was successfulReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract int getMaxPower() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract int getMinPower() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)public abstract RFIDResult blockPermalock(java.lang.String accessPwd, Mask mask, int lock, Mask blockMask) throws ReaderException
accessPwd
- tag's access password.mask
- mask used for filtering tags.lock
- 1 for locking, 0 for reading the Block Permalock state.blockMask
- specifies which memory blocks to permalock. Setting a blockMask bit to 1 will permalock the corresponding memory block.
The bits are ordered from lower-order block to higher.
bitPointer is in units of 16 blocks.
bitLength of 1 means 16 blocks, 2 means 32 blocks etc.RFIDResult.isSuccess()
will return true if the operation was successful or false with the error message if failed.ReaderException
- if the supplied parameter is invalid.public abstract float getTemperature() throws ReaderException
ReaderException
- if there is an errorRFIDBusyException
- if the reader is busy (e.g. performing a continuous inventory)