Generic driver for the RWD RFID Modules from IB Technology.

Dependents:   RSEDP_DPDemo

Embed: (wiki syntax)

« Back to documentation index

RWDModule Class Reference

RWDModule Class Reference

Generic driver for the RWD RFID Modules from IB Technology. More...

#include <RWDModule.h>

Public Member Functions

 RWDModule (PinName tx, PinName rx, PinName cts)
 Creates an instance of the class.
virtual ~RWDModule ()
void command (uint8_t cmd, const uint8_t *params, int paramsLen, uint8_t *resp, size_t respLen, uint8_t ackOk, size_t ackOkMask)
 Executes a command.
bool ready ()
 Ready for a command / response is available.
bool result (uint8_t *pAck=NULL)
 Get whether last command was succesful, and complete ack byte if a ptr is provided.

Detailed Description

Generic driver for the RWD RFID Modules from IB Technology.

The RWD modules from IB Technology are RFID readers working with different frequencies and protocols but with a common instructions set and pinout.

Definition at line 33 of file RWDModule.h.


Constructor & Destructor Documentation

RWDModule ( PinName  tx,
PinName  rx,
PinName  cts 
)

Creates an instance of the class.

Connect module using serial port pins tx, rx and DigitalIn pin cts (clear-to-send).

Definition at line 26 of file RWDModule.cpp.

~RWDModule (  ) [virtual]

Destroys instance.

Definition at line 37 of file RWDModule.cpp.


Member Function Documentation

void command ( uint8_t  cmd,
const uint8_t *  params,
int  paramsLen,
uint8_t *  resp,
size_t  respLen,
uint8_t  ackOk,
size_t  ackOkMask 
)

Executes a command.

Executes the command cmd on the reader, with parameters set in params buffer of paramsLen length. The acknowledge byte sent back by the reader masked with ackOkMask must be equal to ackOk for the command to be considered a success. If so, the result is stored in buffer resp of length respLen. This is a non-blocking function, and ready() should be called to check completion. Please note that the buffers references must remain valid until the command has been executed.

Definition at line 42 of file RWDModule.cpp.

bool ready (  )

Ready for a command / response is available.

Returns true if the previous command has been executed and an other command is ready to be sent.

Definition at line 68 of file RWDModule.cpp.

bool result ( uint8_t *  pAck = NULL )

Get whether last command was succesful, and complete ack byte if a ptr is provided.

Returns true if the previous command was successful. If pAck is provided, the actual acknowledge byte returned by the reader is stored in that variable.

Definition at line 73 of file RWDModule.cpp.