Class UHFReader

    • 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

      • 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 address
        words - 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 occurs
        RFIDReaderException - 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 address
        words - number of words to read (0 for all) - word == 4 byte
        ssl - true for use single slot
        Returns:
        List with data, can include HBE xx for error from the tag
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 address
        hexData - data to write * @return List with "OK!" for success
        Returns:
        list with written tags
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 address
        hexData - data to write
        ssl - true for use single slot
        Returns:
        List with "OK!" for success
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 chip
        hexMaskValue - mask value
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 chip
        hexMaskValue - mask value
        start - start address in bit, default = 0
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 chip
        hexMaskValue - mask value
        start - start address in bit, default = 0
        bitLength - length in bit (max is 248 Bits (31 Byte)). Default = Length of Mask Value (full Nibbles)
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 class MetratecReader<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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 - Data
        isSingleSlot - single slot
        withHandle - true for with handel
        withCRC - true for with crc
        Returns:
        List with the answers
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 - data
        bitLengthData - Length of Data in Bit
        isSingleSlot - single slot
        withHandle - true for with handel
        withCRC - true for with crc
        Returns:
        List with the answers
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 - Data1
        bitLengthData1 - Length of Data 1 in Bit
        data2 - Data 2
        bitLengthData2 - Length of Data 2 in Bit
        isSingleSlot - single slot
        withHandle - true for with handel
        withCRC - true for with crc
        Returns:
        List with the answers
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 - mode
        ssl - 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 occurs
        RFIDReaderException - 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 milliseconds
        lowTimeMS - pin low time in milliseconds
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 use
        commands - list with commands to execute (ASCII protocol commands)
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 call enableStartUpCommands().
        Parameters:
        commands - list with commands to execute (ASCII protocol commands)
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - 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 occurs
        RFIDReaderException - 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 command
        dataBitLength - 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​(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 occurs
        RFIDReaderException - 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 address
        words - number of words to read (0 for all)
        ssl - true for use single slot
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - if an protocol exception occurs (e.g. CRC error, value out of range, ..)