Class RfidScanner<T extends RfidTag>
java.lang.Object
com.tccc.kos.ext.freestyle.service.rfid.RfidScanner<T>
- Direct Known Subclasses:
FreestyleCartridgeScanner
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 Summary
ConstructorsConstructorDescriptionRfidScanner
(RfidAntenna antenna, RfidTagFactory<T> factory) Create a scanner for the specified positions on the specified antenna. -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(RfidTagListener<T> listener) Add a tag listener to the scanner.addPosition
(int pos, Object userData) Add a position to the scanner.int
Return the number of times the scanner has been run.int
Return the number of reads performed when verifying a missing tag.void
removeListener
(RfidTagListener<T> listener) Remove a tag listener from the scanner.void
setScanCount
(int scanCount) void
setVerifyReadCount
(int verifyReadCount) Set the number of reads to perform to verify a tag is missing.
-
Constructor Details
-
RfidScanner
Create a scanner for the specified positions on the specified antenna. TheRfidTagFactory
is used to convert RFID data from the physical tag to a logicalRfidTag
object. The factory can implement multipleRfidReadDescriptor
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 scanfactory
- the factory for generating tags
-
-
Method Details
-
addPosition
Add a position to the scanner.- Parameters:
pos
- the position on the antennauserData
- user data for the position- Returns:
- the newly created
RfidScannerPosition
object
-
addListener
Add a tag listener to the scanner.- Parameters:
listener
- the listener to add
-
removeListener
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
-
setScanCount
public void setScanCount(int scanCount)
-