Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omSerialDriver Class Reference
[DEVICE DRIVER classes of the OpenMAIA Library]

#include <omSerialDriver.h>

Inheritance diagram for omSerialDriver:

omObject

Public Member Functions

 omSerialDriver (omObject *, int, wxString, bool)
void Start ()
void Stop ()
void SetOnPress (bool)
bool GetError ()
void AssignActionEvent (int)
void AssignUpEvent (int)
void AssignDownEvent (int)
void AssignLeftEvent (int)
void AssignRightEvent (int)
void DisableButtonEvent (int)

Private Member Functions

void Notify ()
 Timer notify.

void OpenSerialPort ()

Private Attributes

long actionKey
long upKey
long downKey
long leftKey
long rightKey
bool actionOnPress
omObjecttoInform
 Object to send messages.

int serialFd
 Serial port file descriptor.

wxString serialPort
void(omObject::* fptr [OMSERIALBUTTONNUMBER])()
 function pointer per button

bool enableButton [OMSERIALBUTTONNUMBER]
 enable flags

bool errorStatus
 flag.

bool RIActivated
 Flag.

bool CTSActivated
 Flag.

bool DSRActivated
 Flag.

bool CDActivated
 Flag.

int tickTime
 Pooling interval (ms).


Detailed Description

OpenMAIA Serial Port Driver.

This class is a driver for the OpenMAIA Serial Port interface. OpenMAIA Serial Port interface is a hardware interface that enables the connection of up to 4 external buttons via the serial port RS-232.
Buttons are numerated from 0 to 3.

This class generates events to the object specified in the constructor.
Using the AssignActionEvent, AssignUpEvent, AssignDownEvent, AssignRightEvent and AssignLeftEvent methods you can specify which event should be generated in corrispodence to each button click.
By default every button generates an Action Event.
Event generation may be disabled using DisableButtonEvent() method.


Constructor & Destructor Documentation

omSerialDriver::omSerialDriver omObject object,
int  tick,
wxString  sport,
bool  onpress
 

Initialize the class

Parameters:
object object to inform if event occoured
tick timer pooling interval in milliseconds
sport serial port in un*x format, for example COM1 is /dev/ttyS0 ecc...
onpress actionOnPress flag


Member Function Documentation

void omSerialDriver::AssignActionEvent int  button  ) 
 

Assign Action event to a button.

Parameters:
button button number.

void omSerialDriver::AssignDownEvent int  button  ) 
 

Assign GoDown event to a button.

Parameters:
button button number.

void omSerialDriver::AssignLeftEvent int  button  ) 
 

Assign GoLeft event to a button.

Parameters:
button button number.

void omSerialDriver::AssignRightEvent int  button  ) 
 

Assign GoRight event to a button.

Parameters:
button button number.

void omSerialDriver::AssignUpEvent int  button  ) 
 

Assign GoUp event to a button.

Parameters:
button button number.

void omSerialDriver::DisableButtonEvent int  button  ) 
 

Disable event generation from all buttons. Event generation is abilitated when Assign<EVENT> method is called.

Parameters:
button button number.

bool omSerialDriver::GetError  ) 
 

Return error status.
Error may be true if the class encountred problems in opening serial port.

Returns:
Error status.

void omSerialDriver::Notify  )  [private]
 

Timer notify.

void omSerialDriver::OpenSerialPort  )  [private]
 

void omSerialDriver::SetOnPress bool  op  ) 
 

Set OnPress flag

Parameters:
op value of the onpress flag

void omSerialDriver::Start  )  [virtual]
 

Start the event notify with the time interval specified in the constructor

Reimplemented from omObject.

void omSerialDriver::Stop  )  [virtual]
 

Start the event notify with the time interval specified in the constructor

Reimplemented from omObject.


Field Documentation

long omSerialDriver::actionKey [private]
 

bool omSerialDriver::actionOnPress [private]
 

bool omSerialDriver::CDActivated [private]
 

Flag.

bool omSerialDriver::CTSActivated [private]
 

Flag.

long omSerialDriver::downKey [private]
 

bool omSerialDriver::DSRActivated [private]
 

Flag.

bool omSerialDriver::enableButton[OMSERIALBUTTONNUMBER] [private]
 

enable flags

bool omSerialDriver::errorStatus [private]
 

flag.

void(omObject::* omSerialDriver::fptr[OMSERIALBUTTONNUMBER])() [private]
 

function pointer per button

long omSerialDriver::leftKey [private]
 

bool omSerialDriver::RIActivated [private]
 

Flag.

long omSerialDriver::rightKey [private]
 

int omSerialDriver::serialFd [private]
 

Serial port file descriptor.

wxString omSerialDriver::serialPort [private]
 

int omSerialDriver::tickTime [private]
 

Pooling interval (ms).

omObject* omSerialDriver::toInform [private]
 

Object to send messages.

long omSerialDriver::upKey [private]
 


The documentation for this class was generated from the following files: