SerialPortManager Class Reference

Allows to interact with a SerialPort service.

#include <serialportApi.h>

Public Member Functions

 SerialPortManager (std::string ip="127.0.0.1")
 Handler for command function callback. More...
 
bool isAlive ()
 
void serialPortEvent_S (dpySerialPort::serialport_receive_handler_function handler)
 
void serialPortEvent_U ()
 
void GetSerialPortList (dpySerialPort::serialPort_list_handler handler)
 
boost::system::error_code monitorServiceAvailability_S (dpySerialPort::SerialPortAvailabilityObserver *observer)
 
boost::system::error_code monitorServiceAvailability_U (dpySerialPort::SerialPortAvailabilityObserver *observer)
 
void asyncSetSerialPortConfiguration (dpySerialPort::handler_function handler, const std::string &portid, dpySerialPort::SerialPortConf serialPortConfiguration)
 Modifies serial port configuration. More...
 
void syncSend (dpySerialPort::handler_function handler, const std::string &portid, const std::string &data)
 Send message through serial port. More...
 

Constructor & Destructor Documentation

SerialPortManager ( std::string  ip = "127.0.0.1")
explicit

This type of function is called when a command (start,stop,add,del) callback is done.

Parameters
error_codeerror code (if any)

Member Function Documentation

void asyncSetSerialPortConfiguration ( dpySerialPort::handler_function  handler,
const std::string &  portid,
dpySerialPort::SerialPortConf  serialPortConfiguration 
)
Parameters
handlerHandler to be called when a response comes from the service
portidserial port id
serialPortConfigurationconfiguration of the serial port to modify
void syncSend ( dpySerialPort::handler_function  handler,
const std::string &  portid,
const std::string &  data 
)
Parameters
handlerHandler to be called when a response comes from the service
portidserial port id
datamessage to send. This message is sent as a string. If any special character wants to be sent, escaping will be needed.