component
Class RFIDReader

java.lang.Object
  extended by component.RFIDReader

public class RFIDReader
extends java.lang.Object

[CSE461] Implementation of the RFID Reader, which controls the collision resolution procedure.


Constructor Summary
RFIDReader(RFIDChannel chan)
           
 
Method Summary
 java.util.HashSet<BitMemory> getInventory()
          Retrieves the set of EPCs that the reader thinks it has discovered so far.
 void inventory()
          [CSE461] Main loop of the simulation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFIDReader

public RFIDReader(RFIDChannel chan)
Method Detail

inventory

public void inventory()
               throws SimDoneException
[CSE461] Main loop of the simulation. This is where (most of) your code goes. The goal is to inventory as many tags as you can before time expires. Basically, you sit in a forever loop sending frames to the tags, reading their response(s), and deciding what to do next. Control returns from this method when an exception is thrown (by the RFIDChannel object, not that it matters), indicating that the time limit has expired (the tags have moved out of the field of the reader).

The default implementation first selects all the tags. It then sends a query frame, hoping that exactly one tag will select slot 0 and reply with an RN16 frame. If that doesn't happen, the reader sends another query. If it does happen, the reader tries to read the responding tag's EPC by engaging in the ACK/ECP frame exchange that causes the tag to provide its EPC (assuming no frames are corrupted).

Throws:
SimDoneException

getInventory

public java.util.HashSet<BitMemory> getInventory()
Retrieves the set of EPCs that the reader thinks it has discovered so far.