Class RfidTag
java.lang.Object
com.tccc.kos.ext.freestyle.hardware.rfid.RfidTag
- Direct Known Subclasses:
FreestyleRfidTag
Generic RFID tag base class that just hold banks of data and
information about where the tag was read from.
- Version:
- 2023-09-14
-
Constructor Summary
ConstructorsConstructorDescriptionRfidTag
(RfidAntenna antenna, int physicalPos, short[] epcBank, short[] tidBank, short[] userBank, RfidTagFactory<?> factory, RfidReadDescriptor readDescriptor) Create a tag with the specified data. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
The driver antenna number where the tag was found.short[]
int
int
int
int
int
The logical position of the tag on the antenna.int
Return the physical position of the tag on the antenna.Return a selector for this tag.short[]
short[]
int
hashCode()
void
setInfoAntenna
(int infoAntenna) void
setInfoChannel
(int infoChannel) void
setInfoPhase
(int infoPhase) void
setInfoRSSI
(int infoRSSI) void
setReadDescriptor
(RfidReadDescriptor readDescriptor) void
updateTagData
(RfidWriteData data) Called when writeTag() performs a successful write with updateTag set to true.boolean
writeTag
(RfidWriteData data, boolean updateTag) Write the specified data to this tag.
-
Constructor Details
-
RfidTag
public RfidTag(RfidAntenna antenna, int physicalPos, short[] epcBank, short[] tidBank, short[] userBank, RfidTagFactory<?> factory, RfidReadDescriptor readDescriptor) Create a tag with the specified data.- Parameters:
antenna
- the antenna the tag was read fromphysicalPos
- the physical position on the antennaepcBank
- the epc data from the tagtidBank
- the tid data from the taguserBank
- the user data from the tagfactory
- the factory that is calling this constructor
-
-
Method Details
-
writeTag
Write the specified data to this tag. If updateTag is true and the write is successful, the data will be merged into the underlying tag data.- Parameters:
data
- the data to write to the tagupdateTag
- if true, update the internal tag data after successful write- Returns:
- true if the write was successful
-
updateTagData
Called when writeTag() performs a successful write with updateTag set to true. This is responsible for merging the write data back into this tag. This implementation simply merges the data back into the bank data. If a given tag implementation doesn't keep data in this raw format then it needs to override this method accordingly. -
getAntennaNum
public int getAntennaNum()The driver antenna number where the tag was found. -
getLogicalPos
public int getLogicalPos()The logical position of the tag on the antenna. -
getPhysicalPos
public int getPhysicalPos()Return the physical position of the tag on the antenna. -
getSelector
Return a selector for this tag. By default this returns a selector that matches all bank data exactly. This should be overridden to be more specific to the tag type.- Returns:
- a selector to identify this tag
-
getAntenna
-
getTidBank
public short[] getTidBank() -
getEpcBank
public short[] getEpcBank() -
getUserBank
public short[] getUserBank() -
getFactory
-
getReadDescriptor
-
getInfoRSSI
public int getInfoRSSI() -
getInfoPhase
public int getInfoPhase() -
getInfoChannel
public int getInfoChannel() -
getInfoAntenna
public int getInfoAntenna() -
equals
-
hashCode
public int hashCode() -
setReadDescriptor
-
setInfoRSSI
public void setInfoRSSI(int infoRSSI) -
setInfoPhase
public void setInfoPhase(int infoPhase) -
setInfoChannel
public void setInfoChannel(int infoChannel) -
setInfoAntenna
public void setInfoAntenna(int infoAntenna)
-