Generic scanner input class Generic class to handle various scanner input devices. Provides static initializer method to create the class instance. This instance can be later retrieved by using getScannerInput() method. More...
#include <ScannerInput.h>
Public Types | |
enum | ScannerType { SCANNER_BARCODE = 0, SCANNER_RFID, MAX_READERS } |
Public Member Functions | |
ScannerInput () | |
Class constructor Constructor of the class. The instance of this class should be created by invoking the initialize() method instead. | |
virtual | ~ScannerInput () |
Class destructor Uninitializes the class. Deletes all the reader instances. | |
bool | initScan (int scanner) |
Prepare for scanning Prepares the scanner by calling the appropriate initRead() method for that scanner type. | |
bool | startScan () |
Start scanning Starts the scanning process by calling the appropriate startRead() method for each registered scanner device. | |
bool | stopScan () |
Stop scanning Stops the scanning process by calling the appropriate stopRead() method for each registered scanner device. | |
void | setRfidReadAreas (RfidBank bank, int first_block, int last_block) |
Set the RFID scan areas Sets the RFID areas to be scanned for devices of RFID scanner type. | |
Static Public Member Functions | |
static bool | initialize () |
Start scanner subsystem. | |
static void | shutdown () |
Stop scanner subsystem. | |
static ScannerInput * | getScannerInput () |
Get ScannerInput subsystem. | |
Protected Member Functions | |
bool | init () |
Initialize scanner device Performs per-device initialization. Calls the appropriate initialize() method for each reader type and increments list of available readers if the call was successful. | |
void | close () |
Shutdown scanner devices Performs per-device uninitialization by calling the appropriate shutdown() method for each scanner type. | |
Static Protected Attributes | |
static ScannerInput * | scannerInput = NULL |
Generic scanner input class Generic class to handle various scanner input devices. Provides static initializer method to create the class instance. This instance can be later retrieved by using getScannerInput() method.
The class contains all common methods for handling scanner devices.
ScannerInput::ScannerInput | ( | ) |
Class constructor Constructor of the class. The instance of this class should be created by invoking the initialize() method instead.
The class instance can be later retrieved by getScannerInput() method.
ScannerInput * ScannerInput::getScannerInput | ( | ) | [static] |
Get ScannerInput subsystem.
bool ScannerInput::init | ( | ) | [protected] |
Initialize scanner device Performs per-device initialization. Calls the appropriate initialize() method for each reader type and increments list of available readers if the call was successful.
bool ScannerInput::initialize | ( | ) | [static] |
Start scanner subsystem.
This function initializes scanners and starts the scanner threads.
bool ScannerInput::initScan | ( | int | scanner | ) |
Prepare for scanning Prepares the scanner by calling the appropriate initRead() method for that scanner type.
scanner | Scanner device to be prepared |
void ScannerInput::setRfidReadAreas | ( | RfidBank | bank, | |
int | first_block, | |||
int | last_block | |||
) |
Set the RFID scan areas Sets the RFID areas to be scanned for devices of RFID scanner type.
bank | Specifies the memory region to read from RFID tag (see RfidReader.h for details!) | |
first_block | Specifies the first block number read from the RFID tag | |
last_block | Specifies the last block number read from the RFID tag |
void ScannerInput::shutdown | ( | ) | [static] |
Stop scanner subsystem.
This function shuts down the scanners
bool ScannerInput::startScan | ( | ) |
Start scanning Starts the scanning process by calling the appropriate startRead() method for each registered scanner device.
bool ScannerInput::stopScan | ( | ) |
Stop scanning Stops the scanning process by calling the appropriate stopRead() method for each registered scanner device.
ScannerInput * ScannerInput::scannerInput = NULL [static, protected] |
Instance of this class