Class RfidAntenna
java.lang.Object
com.tccc.kos.ext.freestyle.hardware.rfid.RfidAntenna
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.config.ConfigAware<RfidAntennaConfig>,com.tccc.kos.commons.core.service.handle.HandleAware
public class RfidAntenna
extends Object
implements com.tccc.kos.commons.core.service.config.ConfigAware<RfidAntennaConfig>
This is a single logical antenna which can be scanned.
It specifies details such as the physical antenna number,
position mappings, timeouts and so on.
- Version:
- 2023-09-14
-
Constructor Summary
ConstructorsConstructorDescriptionRfidAntenna(String name, int antennaNum) Create a new antenna for the scanner. -
Method Summary
Modifier and TypeMethodDescriptionintgetBoard()com.tccc.kos.commons.core.service.handle.Handleint[]intgetMaxTags(int pos) Return the max number of tags to expect at a given logical position.intReturn the number of reads that have been performed on this antenna.booleanvoidmapPosition(int logical, int physical) Map a logical position on the antenna to a physical position.voidReset the read count for this antenna.voidsetConfig(RfidAntennaConfig config) voidsetMaxTags(int pos, int maxTags) Set the max number of tags to read for a given logical position.voidsetWriteEnabled(boolean enable) Enable / disable writes from the antenna.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.service.config.ConfigAware
onConfigChanged, onConfigSetMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
-
Constructor Details
-
RfidAntenna
Create a new antenna for the scanner.- Parameters:
name- antenna nameantennaNum- the antenna number
-
-
Method Details
-
mapPosition
public void mapPosition(int logical, int physical) Map a logical position on the antenna to a physical position. By default logical and physical positions are the same, but the mappings can be changed so that logical positions can match higher level mappings, such as slots in a shelf, even when the physical mappings are not naturally ordered in a convenient way.- Parameters:
logical- the logical positionphysical- the physical position
-
setWriteEnabled
public void setWriteEnabled(boolean enable) Enable / disable writes from the antenna. This can be used to block all writes which can be useful during testing to avoid changing tags. -
setMaxTags
public void setMaxTags(int pos, int maxTags) Set the max number of tags to read for a given logical position. This allows the reader to stop reading tags once the max has been reached which greatly speeds up reading. By default, the max number of tags per position is 1, but this can be used to change the value in the event that the antenna is not positional or a given position expects to see more than one tag.- Parameters:
pos- the logical antenna positionmaxTags- the max number of tags to read
-
getMaxTags
public int getMaxTags(int pos) Return the max number of tags to expect at a given logical position.- Parameters:
pos- the logical position on the antenna
-
getReadCount
public int getReadCount()Return the number of reads that have been performed on this antenna. -
resetReadCount
public void resetReadCount()Reset the read count for this antenna. -
getHandle
public com.tccc.kos.commons.core.service.handle.Handle getHandle()- Specified by:
getHandlein interfacecom.tccc.kos.commons.core.service.handle.HandleAware
-
getBoard
-
getAntennaNum
public int getAntennaNum() -
getMaxTags
public int[] getMaxTags() -
isWriteEnabled
public boolean isWriteEnabled() -
getConfig
- Specified by:
getConfigin interfacecom.tccc.kos.commons.core.service.config.ConfigAware<RfidAntennaConfig>
-
setConfig
- Specified by:
setConfigin interfacecom.tccc.kos.commons.core.service.config.ConfigAware<RfidAntennaConfig>
-