Class FreestyleRfidTag
java.lang.Object
com.tccc.kos.ext.freestyle.hardware.rfid.RfidTag
com.tccc.kos.ext.freestyle.hardware.rfid.freestyle.FreestyleRfidTag
Tag data from an rfid tag. This is based entirely on the DEKA docs that
define the tag format. Notice that all the bit fields are referenced as
128-X. This is because the bit numbers in the docs are referenced left to
right vs right to left. To account for this all the shifts are 128 - (bit
position + field width).
There is one change from the DEKA docs which is how pierced weeks is used. In
the docs is stats that this is the number of weeks from manufacture and that
the manufacture date can be derived using the UID and data from an external
system. Since we have no way of looking up the manufacture date, we can't use
it this way. However since the expiration date is always within two years of
manufacture and that date is available, and the pierced weeks field is seven
bits, meaning it can always reach the expiration date, the pierced weeks is
now relative to the expiration date.
The setters in this class modify the underlying bit data such that it can be
written back to the tag using getWords().
- Version:
- Apr-27-17
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionFreestyleRfidTag(RfidAntenna antenna, int pos, short[] epcBank, short[] tidBank, short[] userBank, RfidTagFactory<FreestyleRfidTag> factory, RfidReadDescriptor readDescriptor) Create a tag with the specified data. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetBags()Get the number of bags in the cartridge.intReturn the cartridge number of this tag.Return the enjoy by date.Return the enjoy by date in string format.short[]Override so we can rebuild the epc bank from the bigInt representation as needed.intGet the fitment map.intGet the fluid map.doubleReturn the fuel gauge value.longgetId()Return the unique id of this tag.int[]Return the ingedientIds for this tag.intReturn the package id.intReturn the package version.Get the date the cartridge was pierced.Return the pierced by date in string format.intReturn the plant code for this tag.intIf this is a reserved tag, return the reserved type.Return a selector for this tag.intReturn the tag version.getUin()Return the cartridge UIN of this tag.intgetWidth()Get the cartridge width.inthashCode()booleanReturn the agitation required flag.booleanReturn true if the tag is an antenna tag.booleanReturn true if the tag is an auditor tag.booleanReturn the pierced flag.booleanReturn true if the tag is a product tag.booleanReturn true if the tag is reserved tag.booleanReturn true if the tag is a technician tag.toString()Methods inherited from class com.tccc.kos.ext.freestyle.hardware.rfid.RfidTag
getAntenna, getAntennaNum, getFactory, getInfoAntenna, getInfoChannel, getInfoPhase, getInfoRSSI, getLogicalPos, getPhysicalPos, getReadDescriptor, getTidBank, getUserBank, setInfoAntenna, setInfoChannel, setInfoPhase, setInfoRSSI, setReadDescriptor, updateTagData, writeTag
-
Field Details
-
EPC_WORDS
public static int EPC_WORDS -
RESERVED_LOYALTY
public static final int RESERVED_LOYALTY- See Also:
-
RESERVED_FRU
public static final int RESERVED_FRU- See Also:
-
RESERVED_TECHNICIAN
public static final int RESERVED_TECHNICIAN- See Also:
-
RESERVED_TRAINING
public static final int RESERVED_TRAINING- See Also:
-
RESERVED_AUDITOR
public static final int RESERVED_AUDITOR- See Also:
-
RESERVED_ANTENNA
public static final int RESERVED_ANTENNA- See Also:
-
-
Constructor Details
-
FreestyleRfidTag
public FreestyleRfidTag(RfidAntenna antenna, int pos, short[] epcBank, short[] tidBank, short[] userBank, RfidTagFactory<FreestyleRfidTag> factory, RfidReadDescriptor readDescriptor) Create a tag with the specified data.- Parameters:
antenna- the antenna the tag was read frompos- the 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 constructorreadDescriptor- the descriptor used to read the tag
-
-
Method Details
-
getId
public long getId()Return the unique id of this tag.- Returns:
- the id from the tag
-
getUin
Return the cartridge UIN of this tag. This is just the id in hex form which is used by analytics to match up with labels on the cartridges.- Returns:
- the UIN from the tag
-
getCartridgeNum
public int getCartridgeNum()Return the cartridge number of this tag.- Returns:
- the cartridge number from the tag
-
getPlantCode
public int getPlantCode()Return the plant code for this tag.- Returns:
- the plant code
-
getFluidMap
public int getFluidMap()Get the fluid map.- Returns:
- the fluid map of the cartridge
-
getFitmentMap
public int getFitmentMap()Get the fitment map.- Returns:
- the fitmet map of the cartridge
-
getWidth
public int getWidth()Get the cartridge width.- Returns:
- the width of the cartridge
-
getBags
public int getBags()Get the number of bags in the cartridge.- Returns:
- the number of bags
-
getPackageId
public int getPackageId()Return the package id.- Returns:
- the package id for this tag
-
getPackageVersion
public int getPackageVersion()Return the package version.- Returns:
- the package version for this tag
-
getTagVersion
public int getTagVersion()Return the tag version.- Returns:
- the tag version
-
getIngredientIds
public int[] getIngredientIds()Return the ingedientIds for this tag.- Returns:
- the ingredients in the cartridge
-
getFuelGauge
public double getFuelGauge()Return the fuel gauge value.- Returns:
- the fuel gauge value in ml
-
getEnjoyByDate
Return the enjoy by date.- Returns:
- the enjoy by date
-
getEnjoyByDateStr
Return the enjoy by date in string format.- Returns:
- the enjoy by date in string format
-
isAgitated
public boolean isAgitated()Return the agitation required flag.- Returns:
- true if agitation is required
-
isPierced
public boolean isPierced()Return the pierced flag.- Returns:
- true if the cartridge is pierced
-
getPiercedDate
Get the date the cartridge was pierced. This is an approximate date based on granularity of the data in the tag. Returns null if not pierced.- Returns:
- the approximate date the cartridge was pierced
-
getPiercedDateDateStr
Return the pierced by date in string format.- Returns:
- the pierced date in string format
-
isReserved
public boolean isReserved()Return true if the tag is reserved tag.- Returns:
- true if reserved tag
-
isProduct
public boolean isProduct()Return true if the tag is a product tag.- Returns:
- true for product tag
-
isTechnician
public boolean isTechnician()Return true if the tag is a technician tag.- Returns:
- true if the tag is a technician tag
-
isAntenna
public boolean isAntenna()Return true if the tag is an antenna tag.- Returns:
- true if the tag is an antenna tag
-
isAuditor
public boolean isAuditor()Return true if the tag is an auditor tag.- Returns:
- true if the tag is an auditor tag
-
getReservedType
public int getReservedType()If this is a reserved tag, return the reserved type.- Returns:
- the reserved type of the tag or -1 if not reserved
-
getEpcBank
public short[] getEpcBank()Override so we can rebuild the epc bank from the bigInt representation as needed.- Overrides:
getEpcBankin classRfidTag
-
getSelector
Description copied from class:RfidTagReturn 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.- Overrides:
getSelectorin classRfidTag- Returns:
- a selector to identify this tag
-
equals
-
hashCode
public int hashCode() -
toString
-