Class RfidScanner<T extends RfidTag>

java.lang.Object
com.tccc.kos.ext.freestyle.service.rfid.RfidScanner<T>
Direct Known Subclasses:
FreestyleCartridgeScanner

public class RfidScanner<T extends RfidTag> extends Object
Identifies the positions on an antenna that should be scanned to generate add/remove events. This scanner tracks the tag read from pass to pass and if a tag appears, an add event will be generated. If a tag is no longer visible, a remove event will be generated. This effectively converts tag scanning into an event stream based on tag visibility.

An antenna may be used in multiple scanners, including using the same positions. This will cause the position to be read multiple times, once per scanner.

Version:
2023-10-13
  • Constructor Details

    • RfidScanner

      public RfidScanner(RfidAntenna antenna, RfidTagFactory<T> factory)
      Create a scanner for the specified positions on the specified antenna. The RfidTagFactory is used to convert RFID data from the physical tag to a logical RfidTag object. The factory can implement multiple RfidReadDescriptor which will all be evaluated per tag read (typically resulting in multiple physical reads per position). This allows a high degree of control over what tags are ultimately accepted and generated by this scanner.
      Parameters:
      antenna - the antenna to scan
      factory - the factory for generating tags
  • Method Details

    • addPosition

      public RfidPositionInfo<T> addPosition(int pos, Object userData)
      Add a position to the scanner.
      Parameters:
      pos - the position on the antenna
      userData - user data for the position
      Returns:
      the newly created RfidScannerPosition object
    • addListener

      public RfidScanner<T> addListener(RfidTagListener<T> listener)
      Add a tag listener to the scanner.
      Parameters:
      listener - the listener to add
    • removeListener

      public void removeListener(RfidTagListener<T> listener)
      Remove a tag listener from the scanner.
      Parameters:
      listener - the listener to remove
    • getVerifyReadCount

      public int getVerifyReadCount()
      Return the number of reads performed when verifying a missing tag.
    • setVerifyReadCount

      public void setVerifyReadCount(int verifyReadCount)
      Set the number of reads to perform to verify a tag is missing. This mitigates issues with spurious read failures during normal scanning as it ensures the tag is really gone before generating a remove event.
    • getScanCount

      public int getScanCount()
      Return the number of times the scanner has been run.
    • getAntenna

      public RfidAntenna getAntenna()
    • setScanCount

      public void setScanCount(int scanCount)