Class RfidScanGroup

java.lang.Object
com.tccc.kos.ext.freestyle.service.rfid.RfidScanGroup

public class RfidScanGroup extends Object
A group of RfidScanner objects that are run in a specific order when the group itself matches a requested scan type. Scanners can be added to the group in the specific order in which they should be run. It is possible to add a scanner more than once in order to provide fine grained control over how tags should be scanned. For example, consider multiple shelves of ingredients on a device that also contains an antenna on the door which can be used to scan ingredients. One approach is to add all the shelf scanners and then the door scanner. In this case the door scanner will only be run after all shelves are scanned. However, to improve latency when reading from the door antenna, the door scanner could be added after each shelf antenna, resulting in three door scans for each group scan.

When requesting scans from RfidService, a scanType is specified. This will iterate through all registered groups and only scan those that have a matching scanType. This allows different groups to be created with different purposes. For example, if an inventory scan of all the shelves doesn't want to include door scans, two groups can be created, one with the inventory scan type and the other without.

Version:
2023-10-14
  • Constructor Details

    • RfidScanGroup

      public RfidScanGroup(String name)
      Create a new scan group with the specified name. The name will be added as a scan type for the group. Multiple groups can have the same name, allowing all groups with that name to be scanned in the same cycle.
  • Method Details

    • addType

      public void addType(String scanType)
      Add a type of scan this group should be included in. Scanning is triggered by a type and all groups tagged with this type will be run.
      Parameters:
      scanType - the type to add to the list
    • removeType

      public void removeType(String scanType)
      Remove a type of scan this group should be included in.
      Parameters:
      scanType - the type to remove from the list
    • addScanner

      public void addScanner(RfidScanner<?> scanner)
      Add a RfidAntennaScanner to the group. Scanners will be run in the order in which they're added, and scanners can be added to the group multiple times. This allows a group to provide fine grained control over scanning order and different groups can define different scan ordering.
      Parameters:
      scanner - the scanner to add to the group
    • getName

      public String getName()
    • getScanTypes

      public Set<String> getScanTypes()