8#ifndef YARP_DEV_SERVERSERIAL_H
9#define YARP_DEV_SERVERSERIAL_H
88 if (Thread::isRunning()) {
107 bool send(
char *msg,
size_t size)
override;
110 int flush ()
override;
111 int receiveLine(
char* line,
const int MaxLineLength)
override;
112 int receiveBytes(
unsigned char* bytes,
const int size)
override;
113 bool setDTR(
bool enable)
override;
125 bool close()
override;
Callback implementation after buffered input.
ImplementCallbackHelper2()
Constructor.
yarp::dev::ISerialDevice * ser
void onRead(Bottle &b) override
Callback function.
serial: Export a serial sensor.
void run() override
The thread main loop deals with writing on ports here.
bool close() override
Close the device driver by deallocating all resources and closing ports.
bool setDTR(bool enable) override
Enable/Disable DTR protocol.
virtual bool open()
Default open() method.
int receiveBytes(unsigned char *bytes, const int size) override
Gets an array of bytes (unsigned char) with size <= 'size' parameter.
ServerSerial & operator=(const ServerSerial &)=delete
bool receive(Bottle &msg) override
Gets the existing chars in the receive queue.
int receiveChar(char &c) override
Gets one single char from the receive queue.
int receiveLine(char *line, const int MaxLineLength) override
Gets one line (a sequence of chars with a ending '\n' or '\r') from the receive queue.
ServerSerial(ServerSerial &&)=delete
ServerSerial & operator=(ServerSerial &&)=delete
bool send(const Bottle &msg) override
Sends a string of chars to the serial communications channel.
int flush() override
Flushes the internal buffer.
ServerSerial(const ServerSerial &)=delete
Interface implemented by all device drivers.
A generic interface to serial port devices.
A container for a device driver.
bool close() override
Close the DeviceDriver.
A simple collection of objects that can be described and transmitted in a portable way.
A mini-server for network communication.
void close() override
Stop port activity.
A base class for nested structures that can be searched.
An abstraction for a thread of execution.
A callback for typed data from a port.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.