Class RFIDDevice

All Implemented Interfaces:
Runnable

public class RFIDDevice extends JposDevice implements Runnable
JposDevice based dummy implementation for JavaPOS RFIDScanner device service implementation. No real hardware. All read data with dummy values, operator interaction via OptionDialog boxes.
Supported configuration values for RFIDScanner in jpos.xml can be used to set the corresponding property values:
  • CapContinuousRead: Can be TRUE or FALSE. Default is FALSE.
  • CapDisableTag: Can be TRUE or FALSE. Default is FALSE.
  • CapLockTag: Can be TRUE or FALSE. Default is FALSE.
  • CapMultipleProtocols: Can be set to any hexadecimal value between 0 and 7FFFFFFF.
  • CapReadTimer: Can be TRUE or FALSE. Default is FALSE.
  • CapWriteTag: Can be set to "RFID_CWT_NONE", "RFID_CWT_ID", "RFID_CWT_USERDATA" or "RFID_CWT_ALL".
  • RFIDScannerFileName: Name of the file that consists of RFID label specifications as specified below.
This simulator uses a file to receive the tags to be read. One line per read, at the end restart at line one. Line separator can be CR, LF, CR LF or LF CR.
Each line consists of pairs of hexadecimal values, where the first value of each pair represent a tag ID and the following value the corresponding userdata. Values are separated by spaces. An example:
00000001 123456789abcdef0 0000002 4142434445464748
00000002 3031323334353637 0000011 6162636465666768 00000055 5555555500000000
A file containing the above values would have the following effect:
  • The simulator will read two different labels, one with 2 IDs and one with 3 IDs.
  • The length of each tagID is 4 byte, data length has a maximum of 8 byte per tag.
  • The first tagID if the first label is byte[]{ 0,0,0,1}, the userdata byte[]{0x12, 0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0},
  • The last tagID of the last label is byte[]{0,0,0,'U'}, the userdata byte[]{'U','U','U','U',0,0,0,0}.
  • After the second read, the simulator reads the first label again.
  • Constructor Details

    • RFIDDevice

      protected RFIDDevice(String id) throws jpos.JposException
      The device implementation. See parent for further details.
      Parameters:
      id - Device ID, not used by implementation.
      Throws:
      jpos.JposException - If implementation specific resources are not accessible or defective.
  • Method Details

    • checkProperties

      public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposException
      Description copied from class: JposBaseDevice
      Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value
      Overrides:
      checkProperties in class JposBaseDevice
      Parameters:
      entry - Entry to be checked, contains value to be set
      Throws:
      jpos.JposException - if a property value is invalid
    • changeDefaults

      public void changeDefaults(RFIDScannerProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support RFID scanner services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getRFIDScannerProperties

      public RFIDScannerProperties getRFIDScannerProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of RFIDScannerProperties.
      Overrides:
      getRFIDScannerProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of RFIDScannerProperties that matches the requirements of the corresponding device service.
    • run

      public void run()
      Specified by:
      run in interface Runnable