15 #include <yarp/os/LogStream.h>
16 #include <yarp/os/Value.h>
19 YARP_LOG_COMPONENT(RawValuesPublisherClientParamsCOMPONENT,
"yarp.device.RawValuesPublisherClient")
30 std::vector<std::string> params;
31 params.push_back(
"remote");
32 params.push_back(
"local");
33 params.push_back(
"externalConnection");
34 params.push_back(
"carrier");
42 if (config.check(
"help"))
47 std::string config_string = config.toString();
48 yarp::os::Property prop_check(config_string.c_str());
51 if (config.check(
"remote"))
53 m_remote = config.find(
"remote").asString();
54 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'remote' using value:" <<
m_remote;
58 yCError(RawValuesPublisherClientParamsCOMPONENT) <<
"Mandatory parameter 'remote' not found!";
59 yCError(RawValuesPublisherClientParamsCOMPONENT) <<
"Description of the parameter: Prefix of the ports to which to connect, opened by RawValuesParameterSensorsServer device.";
62 prop_check.unput(
"remote");
67 if (config.check(
"local"))
69 m_local = config.find(
"local").asString();
70 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'local' using value:" <<
m_local;
74 yCError(RawValuesPublisherClientParamsCOMPONENT) <<
"Mandatory parameter 'local' not found!";
75 yCError(RawValuesPublisherClientParamsCOMPONENT) <<
"Description of the parameter: Port prefix of the ports opened by this device.";
78 prop_check.unput(
"local");
83 if (config.check(
"externalConnection"))
86 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'externalConnection' using value:" <<
m_externalConnection;
90 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'externalConnection' using DEFAULT value:" <<
m_externalConnection;
92 prop_check.unput(
"externalConnection");
97 if (config.check(
"carrier"))
99 m_carrier = config.find(
"carrier").asString();
100 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'carrier' using value:" <<
m_carrier;
104 yCInfo(RawValuesPublisherClientParamsCOMPONENT) <<
"Parameter 'carrier' using DEFAULT value:" <<
m_carrier;
106 prop_check.unput(
"carrier");
141 doc = doc + std::string(
"\n=============================================\n");
142 doc = doc + std::string(
"This is the help for device: RawValuesPublisherClient\n");
143 doc = doc + std::string(
"\n");
144 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
145 doc = doc + std::string(
"'remote': Prefix of the ports to which to connect, opened by RawValuesParameterSensorsServer device.\n");
146 doc = doc + std::string(
"'local': Port prefix of the ports opened by this device.\n");
147 doc = doc + std::string(
"'externalConnection': If set to true, the connection to the rpc port of the RVP server is skipped and it is possible to connect to the data source externally after being opened\n");
148 doc = doc + std::string(
"'carrier': The carier used for the connection with the server.\n");
149 doc = doc + std::string(
"\n");
150 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
151 doc = doc +
" yarpdev --device rawValuesPublisherClient --remote <mandatory_value> --local <mandatory_value> --externalConnection false --carrier tcp\n";
152 doc = doc + std::string(
"Using only mandatory params:\n");
153 doc = doc +
" yarpdev --device rawValuesPublisherClient --remote <mandatory_value> --local <mandatory_value>\n";
154 doc = doc + std::string(
"=============================================\n\n");
return doc;
bool parseParams(const yarp::os::Searchable &config)
bool m_externalConnection
RawValuesPublisherClient_ParamsParser()
std::vector< std::string > getListOfParams() const
std::string getDocumentationOfDeviceParams() const