SignStixRfid
This interface is built on top of 'SignStixSerial', but is simpler to use in the case of RFID scenarios such as 'Lift and Learn' or 'Place and Learn' where it's the changes in tags that are of interest, specifically a tag being placed on a pad, or lifted from a pad. These are referred to as 'events'.
Modifier and Type | Function and Description |
---|---|
void |
close()
Stop listening for tag information from connected RFID pads and close any open connections.
|
int |
getNumTagsReadRecently(long periodMs)
Find the number of tags that have recently (within the specified period) been
read by a pad.
|
String |
getPadsInfo()
Return information about all the RFID pads that have been detected and permission granted.
|
String |
getTagsInfo()
Return information about all the tags that have been detected during the current session.
|
void |
prepare(String jsFunctionName)
Prepare to receive tag information from any connected SignStix RFID pads.
|
void |
setSensitivity(int numReadsForAdd,
int numMissesForRemove)
Set the sensitivity regarding the point at which an 'added' or 'removed' event is triggered.
|
void |
setTagReadMode(String mode)
Set the tag read-mode.
|
int |
update()
Tell any attached RFID pads to read the tags in range, prompting calls to
the callback specified in 'prepare'.
|
void prepare(String jsFunctionName)
jsFunctionName
- the name of a Javascript function which will be called when a tag
is added to (or removed from) the set of tags that are in range of the pad(s).
It should take parameters as follows:
void setTagReadMode(String mode)
mode
- "standard" (the default) means to read the built-in tag ID. Use "block" to read a tag's
programmable block ID and convert it from ASCII-encoded bytes to text.void setSensitivity(int numReadsForAdd, int numMissesForRemove)
numReadsForAdd
- the number of times a tag must be read before
the an 'added' event is triggered. Must be at least 1. The default is 2.numMissesForRemove
- the number of times a tag must fail to be read (due to being out of range)
before a 'remove' event is triggered. Must be at least 1. The default is 2.int update()
String getPadsInfo()
[ { "connId": 2, "devPath": "/dev/bus/usb/001/003", "vendorId": "1B4F", "productId": "9204" "numRequests": 8723, "numEvents": 34 }, ... ]
String getTagsInfo()
[ { "tagId": "E5DCBD12", "itemName": "Sauvignon Blanc", "connId": 1, "numReads": 34, "millisSinceLastRead": 873 "status": "present" }, ... ]
int getNumTagsReadRecently(long periodMs)
periodMs
- the period (in milliseconds) up until now to consider.void close()