RFID reader management class Provides methods for managing the RFID (both HF and UHF) readers. More...
#include <RfidReader.h>
Public Types | |
enum | RfidState { STATE_IDLE, STATE_START_READ, STATE_READING, STATE_STOP_READ } |
Public Member Functions | |
RfidReader (RfidReaderType type) | |
Class constructor. | |
virtual | ~RfidReader () |
Class destructor. | |
virtual bool | initialize () |
Reader initialization routine. | |
virtual void | shutdown () |
Reader shutdown routine. | |
virtual void | initRead () |
Prepare for reading. | |
virtual void | startRead () |
Start reading. | |
virtual void | stopRead () |
Stop reading. | |
void | setReadAreas (RfidBank bank, int firstBlock, int lastBlock) |
Set read area. | |
Protected Member Functions | |
virtual void | run () |
Runs RFID reading thread Executes the RFID reading process as a separate thread. | |
virtual void | onTimer () |
Timer event handler. | |
void | submit (const char *id, const char *data) |
Submit the reading data to into event system Broadcasts the data using an EV_READER system event. |
RFID reader management class Provides methods for managing the RFID (both HF and UHF) readers.
Implements appropriate methods from BasicReader class.
Information about UHF EPC GEN2: If the bank is not specified (start<=end), the reader reads only the EPC (ID) and fails when EPC can not be read. If the bank is set, then the reader reads both EPC and specified data region. If one of them fails, the whole read fails and nothing is returned. As most of the tags reply with error code when reading non-existing memory, the user must set the block counts with care; if end count is beyond memory end, the read fails.
RfidReader::RfidReader | ( | RfidReaderType | t | ) |
Class constructor.
Initializes the RFID reader object.
t | Reader type being used |
RfidReader::~RfidReader | ( | ) | [virtual] |
Class destructor.
Terminates the RFID reader object.
bool RfidReader::initialize | ( | ) | [virtual] |
Reader initialization routine.
Initializes RFID reader interface, opens the driver for further communication.
Reimplemented from BasicReader.
void RfidReader::initRead | ( | ) | [virtual] |
Prepare for reading.
Triggers the RFID reader and initiates reading a tag.
Reimplemented from BasicReader.
void RfidReader::onTimer | ( | ) | [protected, virtual] |
Timer event handler.
Stops reading after a timeout
void RfidReader::setReadAreas | ( | RfidBank | b, | |
int | first, | |||
int | last | |||
) |
Set read area.
Selects the blocks that should be read out from an RFID tag when a new read procedure is initiated.
b | Specifies the memory region to read from RFID tag (see RfidReader.h for details!) | |
first | Specifies the first block number read from the RFID tag | |
last | Specifies the last block number read from the RFID tag |
void RfidReader::shutdown | ( | ) | [virtual] |
Reader shutdown routine.
Shuts down the RFID reader interface, closes the driver.
Reimplemented from BasicReader.
void RfidReader::startRead | ( | ) | [virtual] |
void RfidReader::stopRead | ( | ) | [virtual] |
void RfidReader::submit | ( | const char * | id, | |
const char * | data | |||
) | [protected] |
Submit the reading data to into event system Broadcasts the data using an EV_READER system event.
id | Pointer to tag ID that was read | |
data | Pointer to the user data stored in tag |