Barcode reader handler. More...
#include <BarcodeReader.h>
Public Member Functions | |
BarcodeReader () | |
Class constructor. | |
virtual | ~BarcodeReader () |
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. | |
Protected Member Functions | |
virtual void | run () |
Reads the actual data. | |
virtual void | onTimer () |
Timer event handler. | |
void | submit (const char *buf) |
Submit the data to event system. |
Barcode reader handler.
Implements methods to handle the barcode reader. The reader will be be initialized by this class, and the appropriate functions can be called to trigger the laser beam and submit the retrieved data.
BarcodeReader::BarcodeReader | ( | ) |
Class constructor.
Initializes the barcode reader object.
BarcodeReader::~BarcodeReader | ( | ) | [virtual] |
Class destructor.
Terminates the barcode reader object.
bool BarcodeReader::initialize | ( | ) | [virtual] |
Reader initialization routine.
Initializes the barcode reader. Powers up Opticon module up and sends initialization commands via serial port.
Reimplemented from BasicReader.
void BarcodeReader::initRead | ( | ) | [virtual] |
Prepare for reading.
Prepares the Opticon module for reading, enables aiming mode. When aiming, the laser beam is enabled and focused to a single point.
Reimplemented from BasicReader.
void BarcodeReader::onTimer | ( | ) | [protected, virtual] |
Timer event handler.
Stops reading after a timeout
void BarcodeReader::run | ( | ) | [protected, virtual] |
Reads the actual data.
Waits until the data becomes available from the device. Then reads data from the the bar code reader and stores it in the internal buffer.
Reimplemented from Thread.
void BarcodeReader::shutdown | ( | ) | [virtual] |
Reader shutdown routine.
Deinitializes barcode reader. Powers down Opticon reader.
Reimplemented from BasicReader.
void BarcodeReader::startRead | ( | ) | [virtual] |
Start reading.
Starts reading a barcode by triggering the Opticon module. When reading, the laser beam is enabled and scans a line horizontally.
Reimplemented from BasicReader.
void BarcodeReader::stopRead | ( | ) | [virtual] |
Stop reading.
Stops barcode reading. Detriggers the Opticon module and disables laser beam.
Reimplemented from BasicReader.
void BarcodeReader::submit | ( | const char * | buf | ) | [protected] |
Submit the data to event system.
Broadcasts the data read into the event system. The EV_READER system event will be triggered.
buf | Pointer to the buffer that holds the data read |