|
Goby3 3.3.0
2025.07.10
|
provides a basic client for line by line text based communications over a 8N1 tty (such as an RS-232 serial link) without flow control More...
#include <goby/util/linebasedcomms/serial_client.h>
Public Member Functions | |
| SerialClient (std::string name="", unsigned baud=9600, const std::string &delimiter="\r\n") | |
| create a serial client | |
| ~SerialClient () override | |
| void | set_name (const std::string &name) |
| set serial port name, e.g. "/dev/ttyS0" | |
| void | set_baud (unsigned baud) |
| baud rate, e.g. 4800 | |
| std::string | name () const |
| serial port name, e.g. "/dev/ttyS0" | |
| unsigned | baud () const |
| baud rate, e.g. 4800 | |
| std::string | local_endpoint () override |
| our serial port, e.g. "/dev/ttyUSB1" | |
| std::string | remote_endpoint () override |
| who knows where the serial port goes?! (empty string) | |
| void | send_command (const middleware::protobuf::SerialCommand &command) |
| const middleware::protobuf::SerialStatus & | read_status () |
Public Member Functions inherited from goby::util::LineBasedInterface | |
| LineBasedInterface (const std::string &delimiter) | |
| virtual | ~LineBasedInterface () |
| void | start () |
| void | close () |
| bool | active () |
| void | sleep (int sec) |
| bool | readline (std::string *s, AccessOrder order=OLDEST_FIRST) |
| returns string line (including delimiter) | |
| bool | readline (protobuf::Datagram *msg, AccessOrder order=OLDEST_FIRST) |
| void | write (const std::string &s) |
| void | write (const protobuf::Datagram &msg) |
| void | clear () |
| void | set_delimiter (const std::string &s) |
| std::string | delimiter () const |
Additional Inherited Members | |
Public Types inherited from goby::util::LineBasedInterface | |
| enum | AccessOrder { NEWEST_FIRST , OLDEST_FIRST } |
Protected Member Functions inherited from goby::util::LineBasedInterface | |
| void | set_active (bool active) |
| std::string & | delimiter () |
| std::deque< goby::util::protobuf::Datagram > & | in () |
| goby::middleware::InterThreadTransporter & | interthread () |
| int | index () |
| goby::middleware::DynamicGroup & | in_group () |
| goby::middleware::DynamicGroup & | out_group () |
| bool | io_thread_ready () |
provides a basic client for line by line text based communications over a 8N1 tty (such as an RS-232 serial link) without flow control
Definition at line 45 of file serial_client.h.
| goby::util::SerialClient::SerialClient | ( | std::string | name = "", |
| unsigned | baud = 9600, |
||
| const std::string & | delimiter = "\r\n" |
||
| ) |
create a serial client
| name | name of the serial connection (e.g. "/dev/ttyS0") |
| baud | baud rate of the serial connection (e.g. 9600) |
| delimiter | string used to split lines |
|
override |
|
inline |
baud rate, e.g. 4800
Definition at line 67 of file serial_client.h.
|
inlineoverridevirtual |
our serial port, e.g. "/dev/ttyUSB1"
Implements goby::util::LineBasedInterface.
Definition at line 70 of file serial_client.h.
|
inline |
serial port name, e.g. "/dev/ttyS0"
Definition at line 64 of file serial_client.h.
|
inline |
Definition at line 75 of file serial_client.h.
|
inlineoverridevirtual |
who knows where the serial port goes?! (empty string)
Reimplemented from goby::util::LineBasedInterface.
Definition at line 72 of file serial_client.h.
| void goby::util::SerialClient::send_command | ( | const middleware::protobuf::SerialCommand & | command | ) |
|
inline |
baud rate, e.g. 4800
Definition at line 61 of file serial_client.h.
|
inline |
set serial port name, e.g. "/dev/ttyS0"
Definition at line 59 of file serial_client.h.