ScannerInput Class Reference

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>

List of all members.

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 ScannerInputgetScannerInput ()
 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 ScannerInputscannerInput = NULL

Detailed Description

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.


Member Enumeration Documentation

List of scanner types

Enumerator:
SCANNER_BARCODE 

Barcode scanner

SCANNER_RFID 

RFID scanner

MAX_READERS 

Maximum number of available scanner types


Constructor & Destructor Documentation

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.


Member Function Documentation

ScannerInput * ScannerInput::getScannerInput (  )  [static]

Get ScannerInput subsystem.

Returns:
Returns pointer to ScannerInput
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.

Returns:
Returns true if scanner devices were initialized successfully.
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.

Parameters:
scanner Scanner device to be prepared
Returns:
Returns true if the device is prepared successfully.
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.

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

Returns:
Returns true if scanning was successful.
bool ScannerInput::stopScan (  ) 

Stop scanning Stops the scanning process by calling the appropriate stopRead() method for each registered scanner device.

Returns:
Returns true if scanning result was successful.

Member Data Documentation

ScannerInput * ScannerInput::scannerInput = NULL [static, protected]

Instance of this class


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