This class is the parameters parser for class FakeSerialPort. More...
#include <fake/fakeSerialPort/FakeSerialPort_ParamsParser.h>
Classes | |
struct | parser_version_type |
Public Member Functions | |
FakeSerialPort_ParamsParser () | |
~FakeSerialPort_ParamsParser () override=default | |
bool | parseParams (const yarp::os::Searchable &config) override |
Parse the DeviceDriver parameters. | |
std::string | getDeviceClassName () const override |
Get the name of the DeviceDriver class. | |
std::string | getDeviceName () const override |
Get the name of the device (i.e. | |
std::string | getDocumentationOfDeviceParams () const override |
Get the documentation of the DeviceDriver's parameters. | |
std::vector< std::string > | getListOfParams () const override |
Return a list of all params used by the device. | |
bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
Return the value (represented as a string) of the requested parameter. | |
std::string | getConfiguration () const override |
Return the configuration of the device. | |
![]() | |
virtual | ~IDeviceDriverParams () |
Public Attributes | |
const std::string | m_device_classname = {"FakeSerialPort"} |
const std::string | m_device_name = {"fakeSerialPort"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
std::string | m_provided_configuration |
const std::string | m_comport_defaultValue = {"COM3"} |
const std::string | m_verbose_defaultValue = {"1"} |
const std::string | m_baudrate_defaultValue = {"9600"} |
const std::string | m_xonlim_defaultValue = {"0"} |
const std::string | m_xofflim_defaultValue = {"0"} |
const std::string | m_readmincharacters_defaultValue = {"1"} |
const std::string | m_readtimeoutmsec_defaultValue = {"100"} |
const std::string | m_paritymode_defaultValue = {"EVEN"} |
const std::string | m_ctsenb_defaultValue = {"0"} |
const std::string | m_rtsenb_defaultValue = {"0"} |
const std::string | m_xinenb_defaultValue = {"0"} |
const std::string | m_xoutenb_defaultValue = {"0"} |
const std::string | m_modem_defaultValue = {"0"} |
const std::string | m_rcvenb_defaultValue = {"0"} |
const std::string | m_dsrenb_defaultValue = {"0"} |
const std::string | m_dtrdisable_defaultValue = {"0"} |
const std::string | m_databits_defaultValue = {"7"} |
const std::string | m_stopbits_defaultValue = {"1"} |
const std::string | m_line_terminator_char1_defaultValue = {"'\r'"} |
const std::string | m_line_terminator_char2_defaultValue = {"'\n'"} |
std::string | m_comport = {"COM3"} |
int | m_verbose = {1} |
int | m_baudrate = {9600} |
int | m_xonlim = {0} |
int | m_xofflim = {0} |
int | m_readmincharacters = {1} |
int | m_readtimeoutmsec = {100} |
std::string | m_paritymode = {"EVEN"} |
int | m_ctsenb = {0} |
int | m_rtsenb = {0} |
int | m_xinenb = {0} |
int | m_xoutenb = {0} |
int | m_modem = {0} |
int | m_rcvenb = {0} |
int | m_dsrenb = {0} |
int | m_dtrdisable = {0} |
int | m_databits = {7} |
int | m_stopbits = {1} |
char | m_line_terminator_char1 = {'\r'} |
char | m_line_terminator_char2 = {'\n'} |
This class is the parameters parser for class FakeSerialPort.
These are the used parameters:
Group name | Parameter name | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|---|
- | comport | string | - | COM3 | 1 | name of the serial channel | optional, default 1.0s |
- | verbose | int | - | 1 | 0 | Specifies if the device is in verbose mode (0/1) | optional, default 1.0s |
- | baudrate | int | - | 9600 | 1 | Specifies the baudrate at which the communication port operates | optional, default 1.0s |
- | xonlim | int | - | 0 | 0 | Specifies the minimum number of bytes in input buffer before XON char is sent | Negative value indicates that default value should be used (Win32) |
- | xofflim | int | - | 0 | 0 | Specifies the maximum number of bytes in input buffer before XOFF char is sent | Negative value indicates that default value should be used (Win32) |
- | readmincharacters | int | ms | 1 | 0 | Specifies the minimum number of characters for non-canonical read (POSIX) | BEWARE: the exit condition for recv() function is readmincharacters && readtimeoutmsec. |
- | readtimeoutmsec | int | ms | 100 | 0 | Specifies the time to wait before returning from read. Negative value means infinite timeout | BEWARE: the exit condition for recv() function is readmincharacters && readtimeoutmsec. |
- | paritymode | string | - | EVEN | 0 | Specifies the parity mode (EVEN, ODD, NONE | POSIX supports even and odd parity. Additionally Win32 supports mark and space parity modes |
- | ctsenb | int | - | 0 | 0 | Enable & set CTS mode | RTS & CTS are enabled/disabled together on some systems |
- | rtsenb | int | - | 0 | 0 | Enable & set RTS mode | RTS & CTS are enabled/disabled together on some systems. 0 = Disable RTS. 1 = Enable RTS. 2 = Enable RTS flow-control handshaking (Win32). 3 = Specifies that RTS line will be high if bytes are available for transmission. After transmission RTS will be low (Win32) |
- | xinenb | int | - | 0 | 0 | Enable/disable software flow control on input | - |
- | xoutenb | int | - | 0 | 0 | Enable/disable software flow control on output. | - |
- | modem | int | - | 0 | 0 | Specifies if device is a modem (POSIX). If not set modem status lines are ignored. | - |
- | rcvenb | int | - | 0 | 0 | Enable/disable receiver (POSIX). | - |
- | dsrenb | int | - | 0 | 0 | Controls whether DSR is disabled or enabled (Win32). | - |
- | dtrdisable | int | - | 0 | 0 | Controls whether DTR is disabled or enabled | - |
- | databits | int | s | 7 | 0 | Data bits. Valid values 5, 6, 7 and 8 data bits. Additionally Win32 supports 4 data bits. | - |
- | stopbits | int | s | 1 | 0 | Stop bits. Valid values are 1 and 2. | - |
- | line_terminator_char1 | char | - | '\r' | 0 | line terminator character for receiveLine() | - |
- | line_terminator_char2 | char | - | ' ' | 0 | line terminator character for receiveLine() | - |
The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):
Definition at line 60 of file FakeSerialPort_ParamsParser.h.
FakeSerialPort_ParamsParser::FakeSerialPort_ParamsParser | ( | ) |
Definition at line 23 of file FakeSerialPort_ParamsParser.cpp.
|
overridedefault |
|
overridevirtual |
Return the configuration of the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 162 of file FakeSerialPort_ParamsParser.cpp.
|
inlineoverridevirtual |
Get the name of the DeviceDriver class.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 122 of file FakeSerialPort_ParamsParser.h.
|
inlineoverridevirtual |
Get the name of the device (i.e.
the plugin name).
Implements yarp::dev::IDeviceDriverParams.
Definition at line 123 of file FakeSerialPort_ParamsParser.h.
|
overridevirtual |
Get the documentation of the DeviceDriver's parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 495 of file FakeSerialPort_ParamsParser.cpp.
|
overridevirtual |
Return a list of all params used by the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 28 of file FakeSerialPort_ParamsParser.cpp.
|
overridevirtual |
Return the value (represented as a string) of the requested parameter.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 55 of file FakeSerialPort_ParamsParser.cpp.
|
overridevirtual |
Parse the DeviceDriver parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 172 of file FakeSerialPort_ParamsParser.cpp.
int FakeSerialPort_ParamsParser::m_baudrate = {9600} |
Definition at line 102 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_baudrate_defaultValue = {"9600"} |
Definition at line 81 of file FakeSerialPort_ParamsParser.h.
std::string FakeSerialPort_ParamsParser::m_comport = {"COM3"} |
Definition at line 100 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_comport_defaultValue = {"COM3"} |
Definition at line 79 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_ctsenb = {0} |
Definition at line 108 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_ctsenb_defaultValue = {"0"} |
Definition at line 87 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_databits = {7} |
Definition at line 116 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_databits_defaultValue = {"7"} |
Definition at line 95 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_device_classname = {"FakeSerialPort"} |
Definition at line 67 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_device_name = {"fakeSerialPort"} |
Definition at line 68 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_dsrenb = {0} |
Definition at line 114 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_dsrenb_defaultValue = {"0"} |
Definition at line 93 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_dtrdisable = {0} |
Definition at line 115 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_dtrdisable_defaultValue = {"0"} |
Definition at line 94 of file FakeSerialPort_ParamsParser.h.
char FakeSerialPort_ParamsParser::m_line_terminator_char1 = {'\r'} |
Definition at line 118 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_line_terminator_char1_defaultValue = {"'\r'"} |
Definition at line 97 of file FakeSerialPort_ParamsParser.h.
char FakeSerialPort_ParamsParser::m_line_terminator_char2 = {'\n'} |
Definition at line 119 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_line_terminator_char2_defaultValue = {"'\n'"} |
Definition at line 98 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_modem = {0} |
Definition at line 112 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_modem_defaultValue = {"0"} |
Definition at line 91 of file FakeSerialPort_ParamsParser.h.
std::string FakeSerialPort_ParamsParser::m_paritymode = {"EVEN"} |
Definition at line 107 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_paritymode_defaultValue = {"EVEN"} |
Definition at line 86 of file FakeSerialPort_ParamsParser.h.
bool FakeSerialPort_ParamsParser::m_parser_is_strict = false |
Definition at line 69 of file FakeSerialPort_ParamsParser.h.
const parser_version_type FakeSerialPort_ParamsParser::m_parser_version = {} |
Definition at line 75 of file FakeSerialPort_ParamsParser.h.
std::string FakeSerialPort_ParamsParser::m_provided_configuration |
Definition at line 77 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_rcvenb = {0} |
Definition at line 113 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_rcvenb_defaultValue = {"0"} |
Definition at line 92 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_readmincharacters = {1} |
Definition at line 105 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_readmincharacters_defaultValue = {"1"} |
Definition at line 84 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_readtimeoutmsec = {100} |
Definition at line 106 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_readtimeoutmsec_defaultValue = {"100"} |
Definition at line 85 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_rtsenb = {0} |
Definition at line 109 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_rtsenb_defaultValue = {"0"} |
Definition at line 88 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_stopbits = {1} |
Definition at line 117 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_stopbits_defaultValue = {"1"} |
Definition at line 96 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_verbose = {1} |
Definition at line 101 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_verbose_defaultValue = {"1"} |
Definition at line 80 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_xinenb = {0} |
Definition at line 110 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_xinenb_defaultValue = {"0"} |
Definition at line 89 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_xofflim = {0} |
Definition at line 104 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_xofflim_defaultValue = {"0"} |
Definition at line 83 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_xonlim = {0} |
Definition at line 103 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_xonlim_defaultValue = {"0"} |
Definition at line 82 of file FakeSerialPort_ParamsParser.h.
int FakeSerialPort_ParamsParser::m_xoutenb = {0} |
Definition at line 111 of file FakeSerialPort_ParamsParser.h.
const std::string FakeSerialPort_ParamsParser::m_xoutenb_defaultValue = {"0"} |
Definition at line 90 of file FakeSerialPort_ParamsParser.h.