RfidReader Class Reference

RFID reader management class Provides methods for managing the RFID (both HF and UHF) readers. More...

#include <RfidReader.h>

Inheritance diagram for RfidReader:
BasicReader Thread

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

RFID reader states

Enumerator:
STATE_IDLE 

Reader is idle

STATE_START_READ 

The reading process is started

STATE_READING 

Reading is in progress

STATE_STOP_READ 

Reading is finished


Constructor & Destructor Documentation

RfidReader::RfidReader ( RfidReaderType  t  ) 

Class constructor.

Initializes the RFID reader object.

Parameters:
t Reader type being used
RfidReader::~RfidReader (  )  [virtual]

Class destructor.

Terminates the RFID reader object.


Member Function Documentation

bool RfidReader::initialize (  )  [virtual]

Reader initialization routine.

Initializes RFID reader interface, opens the driver for further communication.

Returns:
Returns true if initialization was successful.

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.

Parameters:
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]

Start reading.

Dummy function, currently does nothing.

Reimplemented from BasicReader.

void RfidReader::stopRead (  )  [virtual]

Stop reading.

Instructs the RFID reader to stop reading tags.

Reimplemented from BasicReader.

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.

Parameters:
id Pointer to tag ID that was read
data Pointer to the user data stored in tag

The documentation for this class was generated from the following files:
Generated on Wed Oct 20 11:13:44 2010 for libspatha by  doxygen 1.6.3