serial
: Export a serial sensor.
More...
#include <ServerSerial/ServerSerial.h>
Public Member Functions | |
ServerSerial ()=default | |
ServerSerial (const ServerSerial &)=delete | |
ServerSerial (ServerSerial &&)=delete | |
ServerSerial & | operator= (const ServerSerial &)=delete |
ServerSerial & | operator= (ServerSerial &&)=delete |
~ServerSerial () override | |
bool | send (const Bottle &msg) override |
Sends a string of chars to the serial communications channel. More... | |
bool | send (char *msg, size_t size) override |
bool | receive (Bottle &msg) override |
Gets the existing chars in the receive queue. More... | |
int | receiveChar (char &c) override |
Gets one single char from the receive queue. More... | |
int | flush () override |
Flushes the internal buffer. More... | |
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. More... | |
int | receiveBytes (unsigned char *bytes, const int size) override |
Gets an array of bytes (unsigned char) with size <= 'size' parameter. More... | |
bool | setDTR (bool enable) override |
Enable/Disable DTR protocol. More... | |
virtual bool | open () |
Default open() method. More... | |
bool | close () override |
Close the device driver by deallocating all resources and closing ports. More... | |
bool | open (Searchable &prop) override |
Open the device driver. More... | |
void | run () override |
The thread main loop deals with writing on ports here. More... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::ISerialDevice | |
virtual | ~ISerialDevice () |
serial
: Export a serial sensor.
The network interface is composed by two ports. The input port accepts bottles and sends their contents as text to the serial port. The output port streams out whatever information it gets in the serial port as text bottles.
Definition at line 71 of file ServerSerial.h.
|
default |
|
delete |
|
delete |
|
override |
Definition at line 20 of file ServerSerial.cpp.
|
overridevirtual |
Close the device driver by deallocating all resources and closing ports.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 108 of file ServerSerial.cpp.
|
overridevirtual |
Flushes the internal buffer.
Implements yarp::dev::ISerialDevice.
Definition at line 68 of file ServerSerial.cpp.
|
virtual |
Default open() method.
Definition at line 104 of file ServerSerial.cpp.
|
overridevirtual |
Open the device driver.
prop | is a Searchable object that contains the parameters to use. Allowed parameters are:
|
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 112 of file ServerSerial.cpp.
|
delete |
|
delete |
|
overridevirtual |
Gets the existing chars in the receive queue.
msg | the received string |
Implements yarp::dev::ISerialDevice.
Definition at line 49 of file ServerSerial.cpp.
|
overridevirtual |
Gets an array of bytes (unsigned char) with size <= 'size' parameter.
The array is NOT null terminated.
bytes | a previously allocated buffer where the received data is stored. |
size | the size of the 'bytes' parameter. |
Implements yarp::dev::ISerialDevice.
Definition at line 95 of file ServerSerial.cpp.
|
overridevirtual |
Gets one single char from the receive queue.
chr | the received char. |
Implements yarp::dev::ISerialDevice.
Definition at line 59 of file ServerSerial.cpp.
|
overridevirtual |
Gets one line (a sequence of chars with a ending '\n' or '\r') from the receive queue.
The ending '\n''\r' chars are not removed in the returned line.
line | a previously allocated buffer where the received line is stored. |
MaxLineLength | the size of the 'line' parameter. |
Implements yarp::dev::ISerialDevice.
Definition at line 86 of file ServerSerial.cpp.
|
overridevirtual |
The thread main loop deals with writing on ports here.
Implements yarp::os::Thread.
Definition at line 173 of file ServerSerial.cpp.
|
overridevirtual |
Implements yarp::dev::ISerialDevice.
Definition at line 37 of file ServerSerial.cpp.
|
overridevirtual |
Sends a string of chars to the serial communications channel.
msg | the string to send |
Implements yarp::dev::ISerialDevice.
Definition at line 25 of file ServerSerial.cpp.
|
overridevirtual |
Enable/Disable DTR protocol.
enable | Enable/Disable DTR protocol |
Implements yarp::dev::ISerialDevice.
Definition at line 77 of file ServerSerial.cpp.