RFID tag rigamarole To do list for tomorrow:
- Establish which brand of RFID tags are being used. For "data write" and "data read" operations, "Block Size" (DB-Size) and "Maximum Block Count" (DB-N) might be different for different types of RFID tags. Additionally, different types of tags support different command sets. Finally, different types of tags can store different amounts of data. Reference section 8 (page 69) of the serial protocol document:
http://www.cs.tufts.edu/~apokro01/rfidspecs.pdf- Write startScanner method.
The general idea is to start a loop that goes something like this:
while(not signaled to stop) {
reset();
inventory();
compare list of responding tags to current list of present tags.
for each tag that's in the current list but not in the responding list,
throw out a 'disappear event'
clean the tag out of 'current list'.
for each tag that's not in the current list but in the responding list,
throw out an 'appear event'
add the tag to the 'current list'.
sleep for some waiting period
}
- by contrast, stopScanner() will simply set some signal flag so that on the next iteration of the scan-loop, it'll catch the flag and stop processing.
- Atomic interactions (such as 'read data', 'write data', 'inventory', 'reset', etc) will consist of both sending the command to the RFID reader and waiting for the response.
- Also note that due to the whole 'threading' thing, an atomic interaction will need to acquire a lock on the serial port object before starting its communication and release said lock after getting the full response.