![]() |
template_pkg
1.0.0
A template ROS2 Package
|
A class for serial communication using libserialport. More...
#include <lsp_serial.hpp>


Classes | |
| struct | Params |
| Configuration parameters for the serial connection. More... | |
Public Types | |
| using | byte = uint8_t |
| using | MessageCallback = std::function<void(const std::vector<byte>&)> |
Public Member Functions | |
| LspSerial (Params params) | |
| Constructor for LspSerial. | |
| ~LspSerial () | |
| Destructor for LspSerial. | |
| void | send (const std::vector< byte > &message) override |
| Send a message over the serial connection. | |
| void | spinOnce () override |
| does nothing, legacy from asio boost implementation. | |
| void | addCallback (const MessageCallback &callback) override |
| Set the callback function for received messages. | |
A class for serial communication using libserialport.
This class provides an interface for serial communication using the libserialport library. It implements the TransportInterface for sending and receiving messages over a serial connection.
| using roship_io::transport::LspSerial::byte = uint8_t |
| using roship_io::transport::LspSerial::MessageCallback = std::function<void(const std::vector<byte>&)> |
| TRANSPORT_NS_HEAD LspSerial::LspSerial | ( | Params | params | ) |
Constructor for LspSerial.
| params | Configuration parameters for the serial connection. |
| LspSerial::~LspSerial | ( | ) |
Destructor for LspSerial.
|
overridevirtual |
Set the callback function for received messages.
Implements roship_io::transport::TransportInterface.
|
overridevirtual |
Send a message over the serial connection.
Implements roship_io::transport::TransportInterface.
|
overridevirtual |
does nothing, legacy from asio boost implementation.
Implements roship_io::transport::TransportInterface.