#include <SerialDevice.h>
Public Member Functions | |
bool | ClosePort () |
const char * | GetDevice () const |
bool | OpenPort () |
bool | ReadPort (char *result, int bytes_to_read, int &bytes_read) |
Reads serial port. | |
SerialDevice (const char *device, int baudrate, const char *parity, int datasize) | |
virtual | ~SerialDevice () |
Private Member Functions | |
bool | SetTermSpeed (int speed) |
Set serial communication speed. | |
Private Attributes | |
const int | baudrate_ |
const int | datasize_ |
const std::string | device_ |
const std::string | parity_ |
int | serial_port_ |
Definition at line 37 of file SerialDevice.h.
SerialDevice::SerialDevice | ( | const char * | device, |
int | baudrate, | ||
const char * | parity, | ||
int | datasize | ||
) |
Constructor by default
Definition at line 47 of file SerialDevice.cc.
SerialDevice::~SerialDevice | ( | ) | [virtual] |
Destructor by default
Definition at line 62 of file SerialDevice.cc.
bool SerialDevice::ClosePort | ( | ) |
Closes serial port
Definition at line 138 of file SerialDevice.cc.
const char* SerialDevice::GetDevice | ( | ) | const [inline] |
Definition at line 59 of file SerialDevice.h.
bool SerialDevice::OpenPort | ( | ) |
Definition at line 70 of file SerialDevice.cc.
bool SerialDevice::ReadPort | ( | char * | result, |
int | bytes_to_read, | ||
int & | bytes_read | ||
) |
Reads serial port.
buffer | as char *, output buffer |
bytes_read | as int, number of read bytes |
bytes_to_read | as *int, number of desired bytes to read |
Definition at line 152 of file SerialDevice.cc.
bool SerialDevice::SetTermSpeed | ( | int | speed | ) | [private] |
Set serial communication speed.
Set serial communication speed. Valid values: 9600, 19200, 38400, 115200, 500000
Definition at line 176 of file SerialDevice.cc.
const int SerialDevice::baudrate_ [private] |
Definition at line 45 of file SerialDevice.h.
const int SerialDevice::datasize_ [private] |
Definition at line 47 of file SerialDevice.h.
const std::string SerialDevice::device_ [private] |
Definition at line 41 of file SerialDevice.h.
const std::string SerialDevice::parity_ [private] |
Definition at line 43 of file SerialDevice.h.
int SerialDevice::serial_port_ [private] |
Definition at line 49 of file SerialDevice.h.