Radio
From RifidiWiki
The radio is the component that is the interface between the antennas, and the TagMemory. It's core functionality is in the scan() method.
Contents |
Components of the Radio
- TagMemory - An interface that all readers should use to store tags
- Antenna - The data structure that clients add RifidiTags to
- GenericRadio - The Generic Radio is the interface between the Antenna and the TagMemory.
- RifidiTag - This is the class that stores information that represents a tag
Implementation
Class Structure
Automatic Mode
If this method is used, the radio will automatically keep the Reader's Tag Memory up to date. It works by having the radio observe the antennas. When a tag is added or removed on an antenna, the antenna will notify the radio. This notification will trigger the update() in the radio. This update method will trigger a scan() to happen and the results of the scan (a collection of tags that can be seen on the antennas) will be passed to the Reader's tag memory).
The following is a timing diagram that explains how the Automatic mode should work. It shows this through the Symbol Reader, because the Symbol Reader uses this method.
The objects in this timing diagram:
- Controller Object: This is the outside object that is starting the reader and adding tags to it. Typically, this is the IDE, but it could also be TagStreamer
- SymbolReaderModule: The ReaderModule is the class that handles the construction of the reader. It is invoked by the Controller Object
- SymbolTagMemory: The TagMemory is the object that is responsible for holding the tags that the radio has seen on the antennas, and giving them to the rest of the reader
- Radio: The radio for this reader
- Antenna: The object that the controller object puts the tags on
that The steps in this timing Diagram:
- The IDE starts up the reader by calling the SymbolReaderModule
- The ReaderModule constructs the TagMemory
- The ReaderModule turns on the TagMemory
- The ReaderModule constructs the antennas. It gets the number of antennas to create from the readerProperties that the IDE gives it. It then creates this many antennas and puts them into a HashMap
- The ReaderModule creates the Radio. It passes in the antenna HashMap and the TagMemory. It is important that if you want to use the radio in automatic mode to pass in the tag memory to the Radio's constructor
- The IDE generates tags using the Antenna's static generate tag method
- The IDE puts the tags on the antenna
- The antenna notifies the radio that the tags on it has changed
- The radio scans the antennas and then calls the updateTagMemory() method in the tag memory. It passes in the list of tags that it has seen during the scan to the TagMemory
- The ReaderModule (or any other part of the reader that has access to the tagmemory, such as the handler methods), can now get the tags from the tag memory
The most critical thing to do if you want to use the radio in automatic mode is to pass in the tag memory to the radio at construct time.
Polling Mode
In the polling method, the reader will tell the radio when to scan the antennas and update the tag memory, rather than the tag memory being updated automatically every time a tag is added or removed.
The following is a timing diagram that explains how the Polling mode should work. It shows this through the LLRP Reader, which usess this method
The objects in this timing diagram:
- Controller Object: This is the outside object that is starting the reader and adding tags to it. Typically, this is the IDE, but it could also be TagStreamer
- LLRPReaderModule: The ReaderModule is the class that handles the construction of the reader. It is invoked by the Controller Object
- LLRPTagMemory: The TagMemory is the object that is responsible for holding the tags that the radio has seen on the antennas, and giving them to the rest of the reader
- Radio: The radio for this reader
- Antenna: The object that the controller object puts the tags on
The steps in this timing Diagram:
- The IDE starts up the reader by calling the LLRPReaderModule
- The ReaderModule constructs the TagMemory
- The ReaderModule constructs the antennas. It gets the number of antennas to create from the readerProperties that the IDE gives it. It then creates this many antennas and puts them into a HashMap
- The ReaderModule creates the Radio. It passes in the antenna HashMap, and does not pass in the tag memory. It is important that if you want to use the radio in polling mode that you do not pass in the tag memory to the Radio's constructor
- The ReaderModule turns on the TagMemory
- The IDE generates tags using the Antenna's static generate tag method
- The IDE puts the tags on the antenna
- The ReaderModule (or any other part of the reader, such as the handler method) invokes the radio's scan method, passing in the TagMemory.
- The radio polls its antennas by asking each one for the tags that are currently in their field of view.
- The radio calls the updateTagMemory() method in the tag memory. It passes in the list of tags that it has seen during the scan to the TagMemory
- The ReaderModule (or any other part of the reader that has access to the tagmemory, such as the handler methods), can now get the tags from the tag memory
The most critical thing to do if you want to use the radio in polling mode is that you do not pass the TagMemory to the radio during construct time for the radio, but rather when you call the radio's scan method
Hybrid Mode
It is important to note that Automatic Mode and Polling Mode are not mutually exclusive, but rather two paradigms for using the radio. Both methods can be used together in the same reader. For example, the Alien uses both methods, due to the complicated nature of its persist time functionality.

