Package com.metratec.lib.rfidreader.uhf
Class UHFReader
- java.lang.Object
-
- com.metratec.lib.rfidreader.MetratecReader<T>
-
- com.metratec.lib.rfidreader.MetratecReaderGen1<UhfTag>
-
- com.metratec.lib.rfidreader.uhf.UHFReader
-
- Direct Known Subclasses:
DeskID_UHF
,DwarfG2
,DwarfG2Mini
,PulsarMX
public class UHFReader extends MetratecReaderGen1<UhfTag>
Class for the metraTec uhf reader- Author:
- Matthias Neumann (neumann@metratec.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UHFReader.MEMBANK
Enum for the UHF Tag membankstatic class
UHFReader.PROFILE_PARAMETER
Enum for profile parameterstatic class
UHFReader.READER_MODE
Enum for the RFID communication standards
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RESPONSE_ERROR_FLE
fifo length errorstatic java.lang.String
RESPONSE_ERROR_HBE
fifo length error-
Fields inherited from class com.metratec.lib.rfidreader.MetratecReader
STATE_CONFIGURING, STATE_CONNECTING, STATE_RUNNING, STATE_STOPPED, STATE_WAITING_FOR_RECONNECT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addEPC(boolean state)
By setting this parameter the user activates the EPC-ADD mode.void
addTRS(boolean state)
Sometimes you want to know the received signal strength when communicating with a transponder.boolean
checkCRC16FromDirectCommand(java.lang.String data, int dataBitLength)
checks the crc16 from the DirectCommand answer.void
close()
Deprecated.java.util.List<UhfTag>
directCommand(java.lang.String data, boolean isSingleSlot, boolean withHandle, boolean withCRC)
The direct command is used to access tags with optional or manufacturer specific commands.java.util.List<UhfTag>
directCommand(java.lang.String data, int bitLengthData, boolean isSingleSlot, boolean withHandle, boolean withCRC)
The direct command is used to access tags with optional or manufacturer specific commands.java.util.List<UhfTag>
directCommand(java.lang.String data1, int bitLengthData1, java.lang.String data2, int bitLengthData2, boolean isSingleSlot, boolean withHandle, boolean withCRC)
The direct command is used to access tags with optional or manufacturer specific commands.void
disableAccessPassword()
Disable the access passwordvoid
disableExecuteCommandsOnInput(int pin)
Disable the execute commands on input pinvoid
disableHighOnTag()
Disable the high pin on tag modevoid
disableStartUpCommands()
Disable the start up commandsvoid
enableAdditionalTRS(boolean state)
Sometimes you want to know the received signal strength when communicating with a transponder.void
enableExecuteCommandsOnInput(int pin)
Enable the execute commands on input pinvoid
enableHighOnTag(int highTimeMS, int lowTimeMS)
This method is only usable on DwarfG2, DwarfG2_XR and PulsarMX (a DeskID has no IOs).void
enableStartUpCommands()
Enable the start up commandsint
getAntennaPort()
Set the antenna port.java.lang.String[]
getExecuteCommandsOnInput(int pin)
Get the configured commands on inputjava.lang.Object
getHardwareCommunicationParameter(UHFReader.PROFILE_PARAMETER parameter)
Deprecated.java.util.List<UhfTag>
getInventory()
Looks for all tags in range of the reader and get the EPCs of all tags as a number of strings backjava.util.List<UhfTag>
getInventory(boolean singSlot, boolean onlyNewTag, boolean secure)
Looks for all tags in range of the reader and sends their EPCs as as hex-coded numbers one EPC per line back to the host.int
getInventoryRetry()
Gets the number of retries in tag searching algorithm.java.util.List<UhfTag>
getInventorySingleSlot()
Looks for all tags in range of the reader with single slot and get the EPCs of all tags as a number of strings backint
getPower()
UHFProfileParameter
getProfileParameter()
Gets the profile parameter from the readerjava.lang.Object
getProfilParameter(UHFReader.PROFILE_PARAMETER parameter)
Gets the specific profile parameterint
getQValue()
The Q-Value indicates the starting number of Slots for the tag searching used in every tag command.java.lang.String[]
getStartUpCommands()
Get the configured start up commandsjava.util.List<UhfTag>
getTagData(UHFReader.MEMBANK membank, int startAddress, int words)
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
getTagData(UHFReader.MEMBANK membank, int startAddress, int words, boolean ssl)
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
getTagTIDs()
Reads the TID from the tag.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
getTagTIDs(int length)
Reads the TID from the tag with a predefined length.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
killTag(boolean isSingleSlot)
The Kill Command can be used to disable UHF Gen2 Tags forever.void
loadAccessPassword(int slotNumber)
Loads an access passwordvoid
loadKillPassword(int slotNumber)
Loads a kill passwordjava.util.List<UhfTag>
lockTag(UHFReader.MEMBANK membank, int mode, boolean ssl)
Used to set the access rights of the different data blocks, including the access password itself and the kill password.java.lang.String
readReflectedPower()
Read the reflected power value from the reader front-endvoid
resetMask()
Disable the mask usingvoid
resetRFInterface(int milliseconds)
Timer controlled RF field reset.void
saveAccessPassword(java.lang.String password, int slotNumber)
Saves an access passwordvoid
saveKillPassword(java.lang.String password, int slotNumber)
Saves the kill passwordvoid
scanInventory()
Looks for all tags in range of the reader and call events with founded tags.void
scanInventory(boolean singSlot, boolean onlyNewTag, boolean secure)
Looks for all tags in range of the reader and call events with founded tags.void
scanTagData(UHFReader.MEMBANK membank, int startAddress, int words, boolean ssl)
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.void
setAccessPassword(java.lang.String password)
Sets the access passwordvoid
setAntennaPort(int port)
Set the antenna port.void
setCommunicationChannel(int channel)
Set the etsi channel.void
setEPCMask(java.lang.String mask)
Set a EPC maskvoid
setExecuteCommandsOnInput(int pin, java.lang.String... commands)
This method is only usable on DwarfG2 and PulsarMX (a DeskID has no IOs).void
setGlobalTimeOut(int milliseconds)
Any tag command (INV, RDT etc.) starts a global timeout.void
setInventoryRetry(int value)
Sets the number of retries in tag searching algorithm.void
setKillPassword(java.lang.String password)
Sets the kill passwordvoid
setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue)
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g.void
setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue, int start)
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g.void
setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue, int start, int bitLength)
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g.void
setMode(UHFReader.READER_MODE mode)
Set the reader mode.void
setMultiplexAntennas(int numberOfAntennas)
In case you want to automatically switch between multiple antennas (e.g.void
setNoMask()
Disable the mask usingvoid
setPower(int power)
void
setProfileParameter(UHFReader.PROFILE_PARAMETER parameter, java.lang.Object value)
Sets the given parametervoid
setQValue(int value)
The Q-Value indicates the starting number of Slots for the tag searching used in every tag command.void
setRFInterface(boolean state)
Enable or disable the RF Fieldvoid
setSavePowerMode(boolean state)
If enable the reader will switch off the power amplifier automatically after every tag operation starts (either directly user called or CNR-mode) reducing the power consumption nearly as much as STB (StandyBy need about 3/4 the power of only disabled amplifier) but does not need to be woke up by WAK command.void
setStartUpCommands(java.lang.String... commands)
Sets a number of start up commands.java.util.List<UhfTag>
setTagData(UHFReader.MEMBANK membank, java.lang.String hexData, int startAddress)
Writes data to the tag
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
setTagData(UHFReader.MEMBANK membank, java.lang.String hexData, int startAddress, boolean ssl)
Writes data to the tag
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.java.util.List<UhfTag>
setTagEPC(java.lang.String newEPC)
Sets a new EPC for the tag in the fieldjava.util.List<UhfTag>
setTagEPC(java.lang.String newEPC, java.lang.String tid)
Sets a new epc for a tag, tid is neededjava.util.List<UhfTag>
stopInventory()
Stops the current continues inventory-
Methods inherited from class com.metratec.lib.rfidreader.MetratecReaderGen1
getCRCState, getEndOfFrameState, getFirmwareRevision, getHardwareRevision, getInput, getReaderType, getRevision, getSerialNumber, ping, reset, scanInventory, setOutput, standby, startInventory, stop, wakeUp
-
Methods inherited from class com.metratec.lib.rfidreader.MetratecReader
connect, connect, disconnect, getIdentifier, getInputDebounceTime, getReceiveTimeout, isConnected, setIdentifier, setInputDebounceTime, setMaxReconnectWaitTime, setMinReconnectWaitTime, setReaderEventListener, setReceiveTimeout, setTagEventListener, start, start, startAndWait, startAndWait, startInventory
-
-
-
-
Field Detail
-
RESPONSE_ERROR_FLE
public static final java.lang.String RESPONSE_ERROR_FLE
fifo length error- See Also:
- Constant Field Values
-
RESPONSE_ERROR_HBE
public static final java.lang.String RESPONSE_ERROR_HBE
fifo length error- See Also:
- Constant Field Values
-
-
Method Detail
-
close
@Deprecated public void close() throws CommConnectionException
Deprecated.UseMetratecReaderGen1.stop()
for close the connection- Throws:
CommConnectionException
- possible ICommConnection Error codes:- UNHANDLED_ERROR
-
setMode
public void setMode(UHFReader.READER_MODE mode) throws RFIDReaderException, CommConnectionException
Set the reader mode.- Parameters:
mode
- seeUHFReader.READER_MODE
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setCommunicationChannel
public void setCommunicationChannel(int channel) throws CommConnectionException, RFIDReaderException
Set the etsi channel.- Parameters:
channel
- the channel number starting at zero [0..3]- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
readReflectedPower
public java.lang.String readReflectedPower() throws CommConnectionException, RFIDReaderException
Read the reflected power value from the reader front-end- Returns:
- complex number as two decimal coded values (A-Channel and B-Channel) separated by a whitespace
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getInventory
public java.util.List<UhfTag> getInventory() throws RFIDReaderException, CommConnectionException
Looks for all tags in range of the reader and get the EPCs of all tags as a number of strings back- Specified by:
getInventory
in classMetratecReader<UhfTag>
- Returns:
- List with the EPCs of founded tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getInventorySingleSlot
public java.util.List<UhfTag> getInventorySingleSlot() throws RFIDReaderException, CommConnectionException
Looks for all tags in range of the reader with single slot and get the EPCs of all tags as a number of strings back- Returns:
- List with the EPCs of founded tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getInventory
public java.util.List<UhfTag> getInventory(boolean singSlot, boolean onlyNewTag, boolean secure) throws RFIDReaderException, CommConnectionException
Looks for all tags in range of the reader and sends their EPCs as as hex-coded numbers one EPC per line back to the host. To detect multiple tags at once it uses the anti collision algorithm defined by the EPC UHF Class 1 Gen 2 specification. This is the most common command for almost any UHF RFID application. Using the CNR prefix this command can be used to search for tags continuously. The length of the answer (the length of the EPC) is defined by the Protocol Control (PC) data field on the tag as defined by the EPC Class 1 Gen 2 Protocol.- Parameters:
singSlot
- Single Slot (sets Q and IR values to zero for this round)onlyNewTag
- This flag causes the reader to not reset the state of tags via a select command. Under normal conditions, this causes the tags to be found only once as long as they are not depowered or reset.secure
- This flag causes the reader to bring the tag to secured / open mode. It may help if you need to be sure to find no tag more than once (as long as the tags stay pow- ered). If this flag is not set it is possible under certain circumstances that tags are found multiple times within one inventory cycle.- Returns:
- List with the EPCs of founded tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getTagTIDs
public java.util.List<UhfTag> getTagTIDs() throws CommConnectionException, RFIDReaderException
Reads the TID from the tag.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags. If addEPC and/or addTRS is set, the List with data contains also the EPC and/or the TRS (first entry data, second entry EPC, third entry TRS, and so on).- Returns:
- List with the TIDs
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getTagTIDs
public java.util.List<UhfTag> getTagTIDs(int length) throws CommConnectionException, RFIDReaderException
Reads the TID from the tag with a predefined length.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags. If addEPC and/or addTRS is set, the List with data contains also the EPC and/or the TRS (first entry data, second entry EPC, third entry TRS, and so on).- Parameters:
length
- length of TID words- Returns:
- List with the TIDs, can include HBE xx for error from the tag
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getTagData
public java.util.List<UhfTag> getTagData(UHFReader.MEMBANK membank, int startAddress, int words) throws RFIDReaderException, CommConnectionException
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags. If addEPC and/or addTRS is set, the List with data contains also the EPC and/or the TRS (first entry data, second entry EPC, third entry TRS, and so on).- Parameters:
membank
- MEMBANK (EPC,USR,TID,RES)startAddress
- start addresswords
- number of words to read (0 for all)- Returns:
- List with data, can include HBE xx for error from the tag
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getTagData
public java.util.List<UhfTag> getTagData(UHFReader.MEMBANK membank, int startAddress, int words, boolean ssl) throws RFIDReaderException, CommConnectionException
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags. If addEPC and/or addTRS is set, the List with data contains also the EPC and/or the TRS (first entry data, second entry EPC, third entry TRS, and so on).- Parameters:
membank
- MEMBANK (EPC,USR,TID,RES)startAddress
- start addresswords
- number of words to read (0 for all) - word == 4 bytessl
- true for use single slot- Returns:
- List with data, can include HBE xx for error from the tag
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setTagData
public java.util.List<UhfTag> setTagData(UHFReader.MEMBANK membank, java.lang.String hexData, int startAddress) throws CommConnectionException, RFIDReaderException
Writes data to the tag
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
membank
- MEMBANK (EPC,USR,TID,RES)startAddress
- start addresshexData
- data to write * @return List with "OK!" for success- Returns:
- list with written tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setTagData
public java.util.List<UhfTag> setTagData(UHFReader.MEMBANK membank, java.lang.String hexData, int startAddress, boolean ssl) throws CommConnectionException, RFIDReaderException
Writes data to the tag
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
membank
- MEMBANK (EPC,USR,TID,RES)startAddress
- start addresshexData
- data to writessl
- true for use single slot- Returns:
- List with "OK!" for success
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setEPCMask
public void setEPCMask(java.lang.String mask) throws CommConnectionException, RFIDReaderException
Set a EPC mask- Parameters:
mask
- mask- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setMask
public void setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue) throws CommConnectionException, RFIDReaderException
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g. tags that start with a certain EPC, a certain TID or even contain certain data in the user memory. This is done via a mask given with each command. Using this feature you can address certain tags in the field with directly accessing each tag via its TID or EPC.
Please Note: the tag epc in the tag storage start on bit position 32, if you want filter the tag epc please use the method setMask(MEMBANK.EPC, epc mask in hex, 32)- Parameters:
membank
- membank from the chiphexMaskValue
- mask value- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setMask
public void setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue, int start) throws CommConnectionException, RFIDReaderException
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g. tags that start with a certain EPC, a certain TID or even contain certain data in the user memory. This is done via a mask given with each command. Using this feature you can address certain tags in the field with directly accessing each tag via its TID or EPC.
Please Note: the tag epc in the tag storage start on bit position 32, if you want filter the tag epc please use the method setMask(MEMBANK.EPC, epc mask in hex, 32)- Parameters:
membank
- membank from the chiphexMaskValue
- mask valuestart
- start address in bit, default = 0- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setMask
public void setMask(UHFReader.MEMBANK membank, java.lang.String hexMaskValue, int start, int bitLength) throws CommConnectionException, RFIDReaderException
Most tags manipulation instruction can be limited to a population of tags with certain data values, e.g. tags that start with a certain EPC, a certain TID or even contain certain data in the user memory. This is done via a mask given with each command. Using this feature you can address certain tags in the field with directly accessing each tag via its TID or EPC.
For setting the a epc mask, the start should be 32.- Parameters:
membank
- membank from the chiphexMaskValue
- mask valuestart
- start address in bit, default = 0bitLength
- length in bit (max is 248 Bits (31 Byte)). Default = Length of Mask Value (full Nibbles)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
resetMask
public void resetMask() throws CommConnectionException, RFIDReaderException
Disable the mask using- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setNoMask
public void setNoMask() throws CommConnectionException, RFIDReaderException
Disable the mask using- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setRFInterface
public void setRFInterface(boolean state) throws RFIDReaderException, CommConnectionException
Enable or disable the RF Field- Parameters:
state
- true enable, false disable the RF field- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
resetRFInterface
public void resetRFInterface(int milliseconds) throws CommConnectionException, RFIDReaderException
Timer controlled RF field reset. Turns the field off, waits for the specified number of ms and then turns the field back on. Can be useful to reset all tags in the field without managing everything- Parameters:
milliseconds
- milliseconds- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setSavePowerMode
public void setSavePowerMode(boolean state) throws CommConnectionException, RFIDReaderException
If enable the reader will switch off the power amplifier automatically after every tag operation starts (either directly user called or CNR-mode) reducing the power consumption nearly as much as STB (StandyBy need about 3/4 the power of only disabled amplifier) but does not need to be woke up by WAK command. Also all reader commands are usable with disabled amplifier.- Parameters:
state
- true for enable and false for disable the power save mode- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setProfileParameter
public void setProfileParameter(UHFReader.PROFILE_PARAMETER parameter, java.lang.Object value) throws CommConnectionException, RFIDReaderException
Sets the given parameter- Parameters:
parameter
- parametervalue
- value- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setPower
public void setPower(int power) throws CommConnectionException, RFIDReaderException
- Specified by:
setPower
in classMetratecReaderGen1<UhfTag>
- Parameters:
power
- reader power value- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getPower
public int getPower() throws CommConnectionException, RFIDReaderException
- Returns:
- the current reader power
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an reader exception occurs
-
setAntennaPort
public void setAntennaPort(int port) throws CommConnectionException, RFIDReaderException
Description copied from class:MetratecReader
Set the antenna port.- Specified by:
setAntennaPort
in classMetratecReader<UhfTag>
- Parameters:
port
- antenna port for the connected multiplexer [0..15]- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getAntennaPort
public int getAntennaPort() throws CommConnectionException, RFIDReaderException
Set the antenna port.- Returns:
- the current set antenna port
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setMultiplexAntennas
public void setMultiplexAntennas(int numberOfAntennas) throws CommConnectionException, RFIDReaderException
In case you want to automatically switch between multiple antennas (e.g. trying to find all tags in a search area that can only be searched using multiple antennas) you can use this automatic switching mode.
Switching always starts with the lowest antenna port (0). Switching to the next antenna port oc- curs automatically with the start of every tag manipulation command. No pin state is changed until the first tag manipulation command.- Specified by:
setMultiplexAntennas
in classMetratecReader<UhfTag>
- Parameters:
numberOfAntennas
- number of antennas [1,16], 0 for disable; Please note that for this parameter the number given is the counted number of participating antennas, not the antenna port numbers, thus stating a number "X" would stand for "X antennas participating".- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getHardwareCommunicationParameter
@Deprecated public java.lang.Object getHardwareCommunicationParameter(UHFReader.PROFILE_PARAMETER parameter) throws CommConnectionException, RFIDReaderException
Deprecated.usegetProfilParameter(PROFILE_PARAMETER)
instead
Gets the specific profile parameter- Parameters:
parameter
- parameter- Returns:
- integer or boolean with the value
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getProfilParameter
public java.lang.Object getProfilParameter(UHFReader.PROFILE_PARAMETER parameter) throws CommConnectionException, RFIDReaderException
Gets the specific profile parameter- Parameters:
parameter
- parameter- Returns:
- integer or boolean with the value
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getProfileParameter
public UHFProfileParameter getProfileParameter() throws CommConnectionException, RFIDReaderException
Gets the profile parameter from the reader- Returns:
- the profile parameter
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setGlobalTimeOut
public void setGlobalTimeOut(int milliseconds) throws CommConnectionException, RFIDReaderException
Any tag command (INV, RDT etc.) starts a global timeout. If the function does not terminate - either successful or returning an error � the function will be killed and TOE error code printed. SET GTO changes the timeout value. It is given in decimal milliseconds. Default: 250ms- Parameters:
milliseconds
- timeout in milliseconds (250ms default)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
addEPC
public void addEPC(boolean state) throws CommConnectionException, RFIDReaderException
By setting this parameter the user activates the EPC-ADD mode. If active, every successful tag command and every error code will add the EPC after the answer (read data, "OK!", etc.) of the function and before the optional RSSI values (SET TRS ON/OFF). This makes it easier to identify which tag is actually responding to a command like e.g. Write Data or Read Data.- Parameters:
state
- true for activate, false deactivate- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
addTRS
public void addTRS(boolean state) throws CommConnectionException, RFIDReaderException
Sometimes you want to know the received signal strength when communicating with a transponder. With the TRS setting the reader will automatically add the RSSI to responses from a tag. The value is always negative in a range from -25 to -70 with -25 being the best case. The value will be printed in a new line following the answer of the tag operation and following the EPC if "SET EPC ON" command is used.- Parameters:
state
- true for activate, false deactivate- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
enableAdditionalTRS
public void enableAdditionalTRS(boolean state) throws CommConnectionException, RFIDReaderException
Sometimes you want to know the received signal strength when communicating with a transponder. With the TRS setting the reader will automatically add the RSSI to responses from a tag. The value is always negative in a range from -25 to -70 with -25 being the best case. The value will be printed in a new line following the answer of the tag operation and following the EPC if "SET EPC ON" ommand is used.- Parameters:
state
- true for activate, false deactivate- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
disableAccessPassword
public void disableAccessPassword() throws CommConnectionException, RFIDReaderException
Disable the access password- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setAccessPassword
public void setAccessPassword(java.lang.String password) throws CommConnectionException, RFIDReaderException
Sets the access password- Parameters:
password
- value of 32bit access code (8 characters long hexadecimal string)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
saveAccessPassword
public void saveAccessPassword(java.lang.String password, int slotNumber) throws CommConnectionException, RFIDReaderException
Saves an access password- Parameters:
password
- Value of 32bit Access code (4 byte hexadecimal string)slotNumber
- slot number [1,7]- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
loadAccessPassword
public void loadAccessPassword(int slotNumber) throws CommConnectionException, RFIDReaderException
Loads an access password- Parameters:
slotNumber
- slot number- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setKillPassword
public void setKillPassword(java.lang.String password) throws CommConnectionException, RFIDReaderException
Sets the kill password- Parameters:
password
- value of 32bit access code (4 byte hexadecimal string)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
saveKillPassword
public void saveKillPassword(java.lang.String password, int slotNumber) throws CommConnectionException, RFIDReaderException
Saves the kill password- Parameters:
password
- passwordslotNumber
- slot number- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
loadKillPassword
public void loadKillPassword(int slotNumber) throws CommConnectionException, RFIDReaderException
Loads a kill password- Parameters:
slotNumber
- slot number- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setQValue
public void setQValue(int value) throws CommConnectionException, RFIDReaderException
The Q-Value indicates the starting number of Slots for the tag searching used in every tag command. The number of slots is 2^Q, so Q=0 is used for only one tag (see also SSL, which will set Q=0 temporarily). The maximal value is 15, even though this will result in a timeout error normally. The default value is four (16 Slots), which is fine for up to 8 tags. For more tags change Q to five. Lower Q-Values will fasten the metraTec UHF Protocol Guide Page 20 of 41search, so for 2 Tags Q=2 will be fine (in general: the number of channels should be much bigger (about two times bigger) than the expected number of tags.- Parameters:
value
- value 0 <= Q <= 15- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getQValue
public int getQValue() throws CommConnectionException, RFIDReaderException
The Q-Value indicates the starting number of Slots for the tag searching used in every tag command. The number of slots is 2^Q, so Q=0 is used for only one tag (see also SSL, which will set Q=0 temporarily). The maximal value is 15, even though this will result in a timeout error normally. The default value is four (16 Slots), which is fine for up to 8 tags. For more tags change Q to five. Lower Q-Values will fasten the metraTec UHF Protocol Guide Page 20 of 41search, so for 2 Tags Q=2 will be fine (in general: the number of channels should be much bigger (about two times bigger) than the expected number of tags.- Returns:
- the Q-Value
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setInventoryRetry
public void setInventoryRetry(int value) throws CommConnectionException, RFIDReaderException
Sets the number of retries in tag searching algorithm. Depending on the number of tags in the field and the number of slots (Q-Value) there is the chance of a tag collision. Also, the tag detection communication might be corrupted. Both cases leave a tag undetected but in detectable state (arbitrate). In a new round the tag might be found. IR-Value sets how often a new round can is started (it will not if there is no sign of a missing tag at all). The default value is 2 for DwarfG2 and DeskID_UHF and it's 3 for Pulsar_MX.- Parameters:
value
- value, 0 <= IR <= 10- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getInventoryRetry
public int getInventoryRetry() throws CommConnectionException, RFIDReaderException
Gets the number of retries in tag searching algorithm. Depending on the number of tags in the field and the number of slots (Q-Value) there is the chance of a tag collision. Also, the tag detection communication might be corrupted. Both cases leave a tag undetected but in detectable state (arbitrate). In a new round the tag might be found. IR-Value sets how often a new round can is started (it will not if there is no sign of a missing tag at all). The default value is 2 for DwarfG2 and DeskID_UHF and it's 3 for Pulsar_MX.- Returns:
- the inventory retry value
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
directCommand
public java.util.List<UhfTag> directCommand(java.lang.String data, boolean isSingleSlot, boolean withHandle, boolean withCRC) throws CommConnectionException, RFIDReaderException
The direct command is used to access tags with optional or manufacturer specific commands. It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
data
- DataisSingleSlot
- single slotwithHandle
- true for with handelwithCRC
- true for with crc- Returns:
- List with the answers
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
directCommand
public java.util.List<UhfTag> directCommand(java.lang.String data, int bitLengthData, boolean isSingleSlot, boolean withHandle, boolean withCRC) throws CommConnectionException, RFIDReaderException
The direct command is used to access tags with optional or manufacturer specific commands. It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
data
- databitLengthData
- Length of Data in BitisSingleSlot
- single slotwithHandle
- true for with handelwithCRC
- true for with crc- Returns:
- List with the answers
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
directCommand
public java.util.List<UhfTag> directCommand(java.lang.String data1, int bitLengthData1, java.lang.String data2, int bitLengthData2, boolean isSingleSlot, boolean withHandle, boolean withCRC) throws CommConnectionException, RFIDReaderException
The direct command is used to access tags with optional or manufacturer specific commands. It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
data1
- Data1bitLengthData1
- Length of Data 1 in Bitdata2
- Data 2bitLengthData2
- Length of Data 2 in BitisSingleSlot
- single slotwithHandle
- true for with handelwithCRC
- true for with crc- Returns:
- List with the answers
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
killTag
public java.util.List<UhfTag> killTag(boolean isSingleSlot) throws CommConnectionException, RFIDReaderException
The Kill Command can be used to disable UHF Gen2 Tags forever. To do this the kill password is necessary (four bytes). The password is given via setKillPasswort(..) or is loaded from eeprom via set loadKillPassword(..). It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
isSingleSlot
- use Single Slot or not- Returns:
- List with an "OK!" for every successful Kill, can include Headerbit error (HBE) and Accesserror (ACE)
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
lockTag
public java.util.List<UhfTag> lockTag(UHFReader.MEMBANK membank, int mode, boolean ssl) throws CommConnectionException, RFIDReaderException
Used to set the access rights of the different data blocks, including the access password itself and the kill password.
To use this command you have to be in the secured state. It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags.- Parameters:
membank
- memory type (EPC,TID,USR,ACP,KLP)mode
- modessl
- if true use single Slot- Returns:
- List with an "OK!" for every successful Lock, can include Headerbit error (HBE) and Accesserror (ACE)
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setTagEPC
public java.util.List<UhfTag> setTagEPC(java.lang.String newEPC, java.lang.String tid) throws RFIDReaderException, CommConnectionException
Sets a new epc for a tag, tid is needed- Parameters:
newEPC
- new epctid
- TID- Returns:
- a list with the updated tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setTagEPC
public java.util.List<UhfTag> setTagEPC(java.lang.String newEPC) throws RFIDReaderException, CommConnectionException
Sets a new EPC for the tag in the field- Parameters:
newEPC
- epc as hex- Returns:
- a list with the updated tags
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
enableHighOnTag
public void enableHighOnTag(int highTimeMS, int lowTimeMS) throws CommConnectionException, RFIDReaderException
This method is only usable on DwarfG2, DwarfG2_XR and PulsarMX (a DeskID has no IOs). It makes the reader set and reset an output if at least one tag is found a round (always when there is a IVF >= 1). This works for INV, RDT and so on. Keep in mind: In case of a write it shows NOT a successful writing but just the tag found. The used IO is: GPIO 7 for DwarfG2 and GPO 0 for PulsarMX.- Parameters:
highTimeMS
- pin high time in millisecondslowTimeMS
- pin low time in milliseconds- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
disableHighOnTag
public void disableHighOnTag() throws CommConnectionException, RFIDReaderException
Disable the high pin on tag mode- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setExecuteCommandsOnInput
public void setExecuteCommandsOnInput(int pin, java.lang.String... commands) throws CommConnectionException, RFIDReaderException
This method is only usable on DwarfG2 and PulsarMX (a DeskID has no IOs). It makes the reader call commands on a falling edge of an IO. Supported are pins 0 and 1 (GPI 0/1 on Pulsar, GPIO 0/1 on DwarfG2) with independent state and buffer.- Parameters:
pin
- pin to usecommands
- list with commands to execute (ASCII protocol commands)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
enableExecuteCommandsOnInput
public void enableExecuteCommandsOnInput(int pin) throws CommConnectionException, RFIDReaderException
Enable the execute commands on input pin- Parameters:
pin
- pin- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
disableExecuteCommandsOnInput
public void disableExecuteCommandsOnInput(int pin) throws CommConnectionException, RFIDReaderException
Disable the execute commands on input pin- Parameters:
pin
- pin- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getExecuteCommandsOnInput
public java.lang.String[] getExecuteCommandsOnInput(int pin) throws CommConnectionException, RFIDReaderException
Get the configured commands on input- Parameters:
pin
- pin- Returns:
- list with the commands * @throws CommConnectionException if an communication exception occurs
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
setStartUpCommands
public void setStartUpCommands(java.lang.String... commands) throws CommConnectionException, RFIDReaderException
Sets a number of start up commands. The commands are persistant saved in non volatile memory. The commands are loaded, then parsed and executed as descriped. Even though the executed commands send no answer of any kind. Errors in the commands normally causing UCO or UPA are not detected. So please check the commands for right spelling. To activate please callenableStartUpCommands()
.- Parameters:
commands
- list with commands to execute (ASCII protocol commands)- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
enableStartUpCommands
public void enableStartUpCommands() throws CommConnectionException, RFIDReaderException
Enable the start up commands- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
disableStartUpCommands
public void disableStartUpCommands() throws CommConnectionException, RFIDReaderException
Disable the start up commands- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getStartUpCommands
public java.lang.String[] getStartUpCommands() throws CommConnectionException, RFIDReaderException
Get the configured start up commands- Returns:
- list with the commands * @throws CommConnectionException if an communication exception occurs
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
checkCRC16FromDirectCommand
public boolean checkCRC16FromDirectCommand(java.lang.String data, int dataBitLength) throws RFIDReaderException
checks the crc16 from the DirectCommand answer. The CRC16 is not check by the reader because the data length are not known.- Parameters:
data
- hex data from the direct commanddataBitLength
- bitlength of the data (include headerbit,data,handle and crc)- Returns:
- true if the crc is correct, else false
- Throws:
RFIDReaderException
- possible RFIDErrorCodes:- WPA, data are not hex data
- WDL, data bit length is bigger then the data size or the hex data have a wrong length
-
scanInventory
public void scanInventory() throws CommConnectionException, RFIDReaderException
Looks for all tags in range of the reader and call events with founded tags.- Specified by:
scanInventory
in classMetratecReaderGen1<UhfTag>
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
scanInventory
public void scanInventory(boolean singSlot, boolean onlyNewTag, boolean secure) throws CommConnectionException, RFIDReaderException
Looks for all tags in range of the reader and call events with founded tags.- Parameters:
singSlot
- Single Slot (sets Q and IR values to zero for this round)onlyNewTag
- This flag causes the reader to not reset the state of tags via a select command. Under normal conditions, this causes the tags to be found only once as long as they are not depowered or reset.secure
- This flag causes the reader to bring the tag to secured / open mode. It may help if you need to be sure to find no tag more than once (as long as the tags stay pow- ered). If this flag is not set it is possible under certain circumstances that tags are found multiple times within one inventory cycle.- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
scanTagData
public void scanTagData(UHFReader.MEMBANK membank, int startAddress, int words, boolean ssl) throws RFIDReaderException, CommConnectionException
Reads the data from the tags.
It is possible to mask this command (using the setMask(...) method) to limit this command to a certain population of tags. If addEPC and/or addTRS is set, the List with data contains also the EPC and/or the TRS (first entry data, second entry EPC, third entry TRS, and so on).- Parameters:
membank
- MEMBANK (EPC,USR,TID,RES)startAddress
- start addresswords
- number of words to read (0 for all)ssl
- true for use single slot- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
stopInventory
public java.util.List<UhfTag> stopInventory() throws CommConnectionException, RFIDReaderException
Description copied from class:MetratecReader
Stops the current continues inventory- Overrides:
stopInventory
in classMetratecReaderGen1<UhfTag>
- Returns:
- the current inventory
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs
-
-