component
Class RFIDChannel

java.lang.Object
  extended by component.RFIDChannel

public class RFIDChannel
extends java.lang.Object

An RFIDChannel represents the wireless medium between the reader and the tags. It does a number of things.

First, it delivers a frame from the reader to each of the tags. As it does that, it uses the BER to inject random bit errors, corrupted each bit independently. If the frame type contains a CRC field, it is assumed to detect all bit errors that occur. If the frame does not contain a CRC field, the corrupted packet is delivered.

Second, correct delivery of a frame causes the tag to update its state, and to generate a reply if called for by the current state of the tag and the received frame.

Third, it collects all reply frames. If there is more than one, the reply is unreadable (corrupted). If there is only one, the BER is applied, as in the reader to tag case. If there are no replies, the reply frame is null.

Finally, the RFIDChannel is in control of the simulator's clock. It increments the clock, based on the time required to send the frame from the reader, the time to send the reply frame if there is one, and the required inter-frame gaps. Additionally, when the simuator clock exceeds the time allowed to inventory the tags, an exception is thrown, causing control to exit the RFIDReader.inventory() method.


Field Summary
 int[] frameCnt
           
 
Constructor Summary
RFIDChannel(RFIDTag[] tagArray, double errorRate, double bw, int timeLimit)
          Constructor.
 
Method Summary
 java.lang.String dumpStats(java.lang.String prefix)
          Utility method that returns a printable String summarizing what the channel has seen to this point.
 TtoRFrame sendFrame(RtoTFrame f)
          Delivers frame f to each tag, injecting bit errors as it does so.
 void setDebug(boolean b)
          Control whether the channel should print debugging info (currently a trace of packets sent in each direction).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameCnt

public int[] frameCnt
Constructor Detail

RFIDChannel

public RFIDChannel(RFIDTag[] tagArray,
                   double errorRate,
                   double bw,
                   int timeLimit)
Constructor.

Method Detail

setDebug

public void setDebug(boolean b)
Control whether the channel should print debugging info (currently a trace of packets sent in each direction).


sendFrame

public TtoRFrame sendFrame(RtoTFrame f)
                    throws SimDoneException
Delivers frame f to each tag, injecting bit errors as it does so. (The bit errors are generated independently for each tag.) That causes each tag to take whatever transition is required by the frame it received, and to possibly send a reply frame.

Returns:

Throws:
SimDoneException

dumpStats

public java.lang.String dumpStats(java.lang.String prefix)
Utility method that returns a printable String summarizing what the channel has seen to this point. In the default implementation, this is a table of counts of the various frame types that have been sent.