serialport
: A basic Serial Communications Link (RS232, USB).
More...
#include <serialport/SerialDeviceDriver.h>
Public Member Functions | |
SerialDeviceDriver () | |
virtual | ~SerialDeviceDriver () |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | open (SerialDeviceDriverSettings &config) |
Configures the device. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
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 &chr) override |
Gets one single char 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... | |
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... | |
bool | setDTR (bool value) override |
Enable/Disable DTR protocol. More... | |
int | flush () override |
Flushes the internal buffer. 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 () |
serialport
: A basic Serial Communications Link (RS232, USB).
Definition at line 78 of file SerialDeviceDriver.h.
SerialDeviceDriver::SerialDeviceDriver | ( | ) |
Definition at line 30 of file SerialDeviceDriver.cpp.
|
virtual |
Definition at line 37 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 103 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Flushes the internal buffer.
Implements yarp::dev::ISerialDevice.
Definition at line 204 of file SerialDeviceDriver.cpp.
bool SerialDeviceDriver::open | ( | SerialDeviceDriverSettings & | config | ) |
Configures the device.
The | serial device configuration object |
Definition at line 41 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 68 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Gets the existing chars in the receive queue.
msg | - the received string |
Implements yarp::dev::ISerialDevice.
Definition at line 268 of file SerialDeviceDriver.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 219 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Gets one single char from the receive queue.
chr | - the received char. |
Implements yarp::dev::ISerialDevice.
Definition at line 182 of file SerialDeviceDriver.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 240 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::ISerialDevice.
Definition at line 155 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Sends a string of chars to the serial communications channel.
msg | the string to send |
Implements yarp::dev::ISerialDevice.
Definition at line 118 of file SerialDeviceDriver.cpp.
|
overridevirtual |
Enable/Disable DTR protocol.
enable | Enable/Disable DTR protocol |
Implements yarp::dev::ISerialDevice.
Definition at line 108 of file SerialDeviceDriver.cpp.