27#ifndef GOBY_UTIL_LINEBASEDCOMMS_SERIAL_CLIENT_H
28#define GOBY_UTIL_LINEBASEDCOMMS_SERIAL_CLIENT_H
64 std::string
name()
const {
return name_; }
67 unsigned baud()
const {
return baud_; }
91 std::atomic<bool> serial_alive_{
false};
92 std::unique_ptr<std::thread> serial_thread_;
Reads/Writes strings from/to serial port using a line-based (typically ASCII) protocol with a defined...
std::string delimiter() const
virtual void do_start()=0
virtual void do_close()=0
virtual void do_subscribe()=0
LineBasedInterface(const std::string &delimiter)
std::string local_endpoint() override
our serial port, e.g. "/dev/ttyUSB1"
std::string name() const
serial port name, e.g. "/dev/ttyS0"
const middleware::protobuf::SerialStatus & read_status()
unsigned baud() const
baud rate, e.g. 4800
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
SerialClient(std::string name="", unsigned baud=9600, const std::string &delimiter="\r\n")
create a serial client
void send_command(const middleware::protobuf::SerialCommand &command)
std::string remote_endpoint() override
who knows where the serial port goes?! (empty string)
constexpr goby::middleware::Group linebasedcomms_in
constexpr goby::middleware::Group linebasedcomms_out
The global namespace for the Goby project.