#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 () |
| |
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 52 of file serial.cxx.
References open_port(), and set_baud().
| bool SGSerialPort::open_port | ( | const string & | device | ) |
Open a the serial port.
| device | name of device |
Definition at line 66 of file serial.cxx.
References SG_LOG.
Referenced by SGSerial::open(), and SGSerialPort().
| bool SGSerialPort::close_port | ( | ) |
Close the serial port.
Definition at line 154 of file serial.cxx.
Referenced by SGSerial::close().
| bool SGSerialPort::set_baud | ( | int | baud | ) |
Set baud rate.
| baud | baud rate |
Definition at line 167 of file serial.cxx.
References SG_LOG.
Referenced by SGSerial::open(), and SGSerialPort().
| string SGSerialPort::read_port | ( | ) |
Read from the serial port.
Definition at line 276 of file serial.cxx.
References SG_LOG.
Referenced by SGSerial::read(), and SGSerial::readline().
| 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 332 of file serial.cxx.
References SG_LOG.
| int SGSerialPort::write_port | ( | const string & | value | ) |
Write to the serial port.
| value | output string |
Definition at line 389 of file serial.cxx.
References SG_LOG.
Referenced by SGSerial::write().
| 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 464 of file serial.cxx.
References SG_LOG.
1.5.1