Class FreestyleRfidTag

java.lang.Object
com.tccc.kos.ext.freestyle.hardware.rfid.RfidTag
com.tccc.kos.ext.freestyle.hardware.rfid.freestyle.FreestyleRfidTag

public class FreestyleRfidTag extends RfidTag
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 Details

  • 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 from
      pos - the position on the antenna
      epcBank - the epc data from the tag
      tidBank - the tid data from the tag
      userBank - the user data from the tag
      factory - the factory that is calling this constructor
      readDescriptor - 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

      public String 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

      public Date getEnjoyByDate()
      Return the enjoy by date.
      Returns:
      the enjoy by date
    • getEnjoyByDateStr

      public String 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

      public Date 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

      public String 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:
      getEpcBank in class RfidTag
    • getSelector

      public RfidTagSelector getSelector()
      Description copied from class: RfidTag
      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.
      Overrides:
      getSelector in class RfidTag
      Returns:
      a selector to identify this tag
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class RfidTag
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class RfidTag
    • toString

      public String toString()
      Overrides:
      toString in class Object