A class to encapsulate low level serial port IO. More...
#include <serial.hxx>
Public Member Functions | |
| SGSerialPort () | |
| Default constructor. | |
| SGSerialPort (const string &device, int baud) | |
| Constructor. | |
| ~SGSerialPort () | |
| Destructor. | |
| bool | open_port (const string &device) |
| Open a the serial port. | |
| bool | close_port () |
| Close the serial port. | |
| bool | set_baud (int baud) |
| Set baud rate. | |
| string | read_port () |
| Read from the serial port. | |
| int | read_port (char *buf, int len) |
| Read from the serial port. | |
| int | write_port (const string &value) |
| Write to the serial port. | |
| int | write_port (const char *buf, int len) |
| Write to the serial port. | |
| bool | is_enabled () |
A class to encapsulate low level serial port IO.
Definition at line 50 of file serial.hxx.
| SGSerialPort::SGSerialPort | ( | const string & | device, | |
| int | baud | |||
| ) |
Constructor.
| device | device name | |
| baud | baud rate |
Definition at line 47 of file serial.cxx.
| bool SGSerialPort::close_port | ( | ) |
| bool SGSerialPort::is_enabled | ( | ) | [inline] |
Definition at line 121 of file serial.hxx.
| bool SGSerialPort::open_port | ( | const string & | device | ) |
Open a the serial port.
| device | name of device |
Definition at line 61 of file serial.cxx.
| int SGSerialPort::read_port | ( | char * | buf, | |
| int | len | |||
| ) |
Read from the serial port.
| buf | input buffer | |
| len | length of buffer (i.e. max number of bytes to read |
Definition at line 327 of file serial.cxx.
| string SGSerialPort::read_port | ( | ) |
| bool SGSerialPort::set_baud | ( | int | baud | ) |
Set baud rate.
| baud | baud rate |
Definition at line 162 of file serial.cxx.
| int SGSerialPort::write_port | ( | const char * | buf, | |
| int | len | |||
| ) |
Write to the serial port.
| buf | pointer to character buffer containing output data | |
| len | number of bytes to write from the buffer |
Definition at line 459 of file serial.cxx.
| int SGSerialPort::write_port | ( | const string & | value | ) |
Write to the serial port.
| value | output string |
Definition at line 384 of file serial.cxx.
1.6.1