30 std::vector<std::string> params;
31 params.push_back(
"local");
32 params.push_back(
"remote");
33 params.push_back(
"rpc_carrier");
34 params.push_back(
"rpc_timeout");
35 params.push_back(
"carrier");
42 if (paramName ==
"local")
47 if (paramName ==
"remote")
52 if (paramName ==
"rpc_carrier")
57 if (paramName ==
"rpc_timeout")
62 if (paramName ==
"carrier")
68 yError() <<
"parameter '" << paramName <<
"' was not found";
87 if (config.
check(
"help"))
96 if (config.
check(
"local"))
99 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'local' using value:" <<
m_local;
103 yCError(Battery_nwc_yarpParamsCOMPONENT) <<
"Mandatory parameter 'local' not found!";
104 yCError(Battery_nwc_yarpParamsCOMPONENT) <<
"Description of the parameter: Full port name opened by the nwc device.";
107 prop_check.
unput(
"local");
112 if (config.
check(
"remote"))
115 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'remote' using value:" <<
m_remote;
119 yCError(Battery_nwc_yarpParamsCOMPONENT) <<
"Mandatory parameter 'remote' not found!";
120 yCError(Battery_nwc_yarpParamsCOMPONENT) <<
"Description of the parameter: Full port name of the port remotely opened by the nws device, to which the nwc connects to.";
123 prop_check.
unput(
"remote");
128 if (config.
check(
"rpc_carrier"))
131 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'rpc_carrier' using value:" <<
m_rpc_carrier;
135 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'rpc_carrier' using DEFAULT value:" <<
m_rpc_carrier;
137 prop_check.
unput(
"rpc_carrier");
142 if (config.
check(
"rpc_timeout"))
145 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'rpc_timeout' using value:" <<
m_rpc_timeout;
149 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'rpc_timeout' using DEFAULT value:" <<
m_rpc_timeout;
151 prop_check.
unput(
"rpc_timeout");
156 if (config.
check(
"carrier"))
159 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier' using value:" <<
m_carrier;
163 yCInfo(Battery_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier' using DEFAULT value:" <<
m_carrier;
165 prop_check.
unput(
"carrier");
200 doc = doc + std::string(
"\n=============================================\n");
201 doc = doc + std::string(
"This is the help for device: Battery_nwc_yarp\n");
202 doc = doc + std::string(
"\n");
203 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
204 doc = doc + std::string(
"'local': Full port name opened by the nwc device.\n");
205 doc = doc + std::string(
"'remote': Full port name of the port remotely opened by the nws device, to which the nwc connects to.\n");
206 doc = doc + std::string(
"'rpc_carrier': The carrier used for the RPC connection with the server.\n");
207 doc = doc + std::string(
"'rpc_timeout': Timeout for RPC calls. Default value: -1 = infinite\n");
208 doc = doc + std::string(
"'carrier': The carrier used for the streaming connection with the server.\n");
209 doc = doc + std::string(
"\n");
210 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
211 doc = doc +
" yarpdev --device battery_nwc_yarp --local <mandatory_value> --remote <mandatory_value> --rpc_carrier fast_tcp --rpc_timeout -1 --carrier fast_tcp\n";
212 doc = doc + std::string(
"Using only mandatory params:\n");
213 doc = doc +
" yarpdev --device battery_nwc_yarp --local <mandatory_value> --remote <mandatory_value>\n";
214 doc = doc + std::string(
"=============================================\n\n");
return doc;
Battery_nwc_yarp_ParamsParser()
std::string m_rpc_carrier
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_provided_configuration
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)