Class MetratecReader<T extends RfidTag>

  • Type Parameters:
    T - the rfid tag instance
    Direct Known Subclasses:
    MetratecReaderGen1, MetratecReaderGen2

    public abstract class MetratecReader<T extends RfidTag>
    extends java.lang.Object
    Author:
    jannis becke, matthias neumann
    • Field Detail

      • STATE_CONNECTING

        public static final int STATE_CONNECTING
        the master is connecting
        See Also:
        Constant Field Values
      • STATE_RUNNING

        public static final int STATE_RUNNING
        the master is running
        See Also:
        Constant Field Values
      • STATE_STOPPED

        public static final int STATE_STOPPED
        the master is stopped
        See Also:
        Constant Field Values
      • STATE_WAITING_FOR_RECONNECT

        public static final int STATE_WAITING_FOR_RECONNECT
        the master is waiting during reconnect
        See Also:
        Constant Field Values
      • STATE_CONFIGURING

        public static final int STATE_CONFIGURING
        the master is being configured
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetratecReader

        public MetratecReader​(java.lang.String identifier,
                              ICommConnection connection)
        Construct a new StandardReader instance with the specified connection
        Parameters:
        identifier - reader identifier
        connection - connection
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        Returns:
        the identifier
      • setIdentifier

        public void setIdentifier​(java.lang.String identifier)
        Parameters:
        identifier - the identifier to set
      • start

        public void start()
        Start the reader
      • start

        public void start​(int heartBeatInterval)
        Start the reader
        Parameters:
        heartBeatInterval - heart beat interval in seconds
      • isConnected

        public boolean isConnected()
        Returns:
        the connection state
      • setMaxReconnectWaitTime

        public void setMaxReconnectWaitTime​(long timeInMilliseconds)
        Set the minimum time before attempting to reconnect. Default value 21600000ms (6h).
        Parameters:
        timeInMilliseconds - maximum reconnect wait time in milliseconds
      • setMinReconnectWaitTime

        public void setMinReconnectWaitTime​(long timeInMilliseconds)
        Set the minimum time before attempting to reconnect. Default value 2000ms.
        Parameters:
        timeInMilliseconds - minimum reconnect wait time in milliseconds
      • getReceiveTimeout

        public int getReceiveTimeout()
        Returns:
        the receiveTimeout
      • setReceiveTimeout

        public void setReceiveTimeout​(int receiveTimeout)
        Parameters:
        receiveTimeout - the receiveTimeout to set
      • getInputDebounceTime

        public int getInputDebounceTime()
        Returns:
        the inputDebounceTime
      • setInputDebounceTime

        public void setInputDebounceTime​(int inputDebounceTime)
        Parameters:
        inputDebounceTime - the inputDebounceTime to set (minimum 50ms)
      • getHardwareRevision

        public abstract java.lang.String getHardwareRevision()
                                                      throws RFIDReaderException,
                                                             CommConnectionException
        Gets the hardware revision
        Returns:
        the hardware revision of the reader which corresponds to the PCB layout version printed on the board. The number is an ASCII string of four characters.
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - if an protocol exception occurs (e.g. CRC error, value out of range, ..)
      • setMultiplexAntennas

        public abstract 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.
        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, ..)
      • startInventory

        public abstract void startInventory​(long tagLostTime)
                                     throws CommConnectionException,
                                            RFIDReaderException
        Looks for all tags in range of the reader and call events with founded tags.
        Parameters:
        tagLostTime - timeout in milliseconds for tag lost event
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - if an protocol exception occurs (e.g. CRC error, value out of range, ..)