|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
41 if (!writer.
writeTag(
"getMetadata", 1, 1)) {
69 if (!
yarp().canWrite()) {
70 yError(
"Missing server method '%s'?",
"SensorRPCData MultipleAnalogSensorsMetadata::getMetadata()");
79 bool showAll = (functionName ==
"--all");
80 std::vector<std::string> helpString;
82 helpString.emplace_back(
"*** Available commands:");
83 helpString.emplace_back(
"getMetadata");
84 helpString.emplace_back(
"help");
86 if (functionName ==
"getMetadata") {
87 helpString.emplace_back(
"SensorRPCData getMetadata() ");
88 helpString.emplace_back(
"Read the sensor metadata necessary to configure the MultipleAnalogSensorsClient device. ");
90 if (functionName ==
"help") {
91 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
92 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
93 helpString.emplace_back(
"@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands");
94 helpString.emplace_back(
"@return list of strings (one string per line)");
97 if (helpString.empty()) {
98 helpString.emplace_back(
"Command not found");
113 std::string tag = reader.
readTag();
114 bool direct = (tag ==
"__direct__");
119 if (tag ==
"getMetadata") {
134 std::string functionName;
136 functionName =
"--all";
138 auto help_strings =
help(functionName);
144 if (!writer.
writeTag(
"many", 1, 0)) {
150 for (
const auto& help_string : help_strings) {
166 std::string next_tag = reader.
readTag();
167 if (next_tag ==
"") {
170 tag.append(
"_").append(next_tag);
bool readString(std::string &str, bool *is_vocab=nullptr)
This is a base class for objects that can be both read from and be written to the YARP network.
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
bool writeString(const std::string &tag) const
bool writeListHeader(int len) const
IDL-friendly connection writer.
An interface for writing to a network connection.
bool write(const WirePortable &obj) const
bool read(WirePortable &obj)
bool writeTag(const char *tag, int split, int len) const
IDL-friendly connection reader.
An interface for reading from a network connection.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
bool writeListBegin(int tag, std::uint32_t len) const
bool writeListEnd() const