Regilo
A simple C++ library for controlling the Neato XV robot and the Hokuyo scanner.
|
The SerialController class is used to communicate with a device using the serial port. More...
#include <serialcontroller.hpp>
Public Member Functions | |
virtual void | connect (const std::string &endpoint) override |
Connect the controller to a device. More... | |
virtual std::string | getEndpoint () const override |
Get the endpoint of device. More... | |
![]() | |
virtual std::string | sendCommand (const std::string &command) final override |
Send a command to the device. More... | |
Response | sendCommand (const Command &command) |
Send a command to the device. More... | |
Response | sendCommand (const Command &command, const Args &...params) |
Send a command to the device. More... | |
StreamController () | |
Default constructor. | |
StreamController (const std::string &logPath) | |
Controller with a log file specified by a path. More... | |
StreamController (std::iostream &logStream) | |
Controller with a log specified by a stream. More... | |
virtual | ~StreamController () |
Default destructor. | |
virtual bool | isConnected () const override |
Test if the controller is connected. More... | |
virtual std::shared_ptr< ILog > | getLog () override |
Get the current Log. More... | |
virtual std::shared_ptr< const ILog > | getLog () const override |
Get the current Log (a const variant). More... | |
virtual void | setLog (std::shared_ptr< ILog > log) override |
Set a Log (it can be shared between more controllers). More... | |
Response | sendFormattedCommand (const std::string &commandFormat, Args...params) |
Create a command with the specified parameters (printf formatting is used) and send it to the device. More... | |
std::string | createFormattedCommand (const std::string &commandFormat, Args...params) const |
Create a command with the specified parameters (printf formatting is used). More... | |
![]() | |
virtual | ~IController ()=default |
Default destructor. | |
Additional Inherited Members | |
![]() | |
typedef ba::serial_port | Stream |
The stream type for this Controller. | |
![]() | |
std::string | REQUEST_END |
A string that the request ends with. | |
std::string | RESPONSE_END |
A string that the response ends with. | |
bool | readResponse |
If true the sendCommand method reads a response. | |
bool | readCommand |
If true the input command is read from the response at first. | |
![]() | |
void | sendCommand () |
Send a command from the device input to the device. | |
Response | sendCommand () |
Send a command from the device input to the device. More... | |
![]() | |
std::istringstream | deviceOutput |
A buffer for the device output. | |
std::ostringstream | deviceInput |
A buffer for the device input. | |
ba::io_service | ioService |
The Boost IO service. | |
ba::serial_port | stream |
A stream (TCP, socket, etc.) that is used for read/write operations. | |
std::shared_ptr< Log > | log |
A log that is connected to the controller. | |
The SerialController class is used to communicate with a device using the serial port.
|
overridevirtual |
Connect the controller to a device.
endpoint | The endpoint with the path to the device (e.g. "/dev/ttyACM0"). |
Implements regilo::IController.
|
inlineoverridevirtual |
Get the endpoint of device.
Implements regilo::IController.