#include <omSerialDriver.h>
Inheritance diagram for omSerialDriver:
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:
-
|
void omSerialDriver::AssignDownEvent |
( |
int |
button |
) |
|
|
|
Assign GoDown event to a button. - Parameters:
-
|
void omSerialDriver::AssignLeftEvent |
( |
int |
button |
) |
|
|
|
Assign GoLeft event to a button. - Parameters:
-
|
void omSerialDriver::AssignRightEvent |
( |
int |
button |
) |
|
|
|
Assign GoRight event to a button. - Parameters:
-
|
void omSerialDriver::AssignUpEvent |
( |
int |
button |
) |
|
|
|
Assign GoUp event to a button. - Parameters:
-
|
void omSerialDriver::DisableButtonEvent |
( |
int |
button |
) |
|
|
|
Disable event generation from all buttons. Event generation is abilitated when Assign<EVENT> method is called.
- Parameters:
-
|
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] |
|
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
|
function pointer per button
|
|
Serial port file descriptor.
|
The documentation for this class was generated from the following files: