38 if (!writer.
writeTag(
"getMetadata", 1, 1)) {
66 if (!
yarp().canWrite()) {
67 yError(
"Missing server method '%s'?",
"SensorRPCData MultipleAnalogSensorsMetadata::getMetadata()");
76 bool showAll = (functionName ==
"--all");
77 std::vector<std::string> helpString;
79 helpString.emplace_back(
"*** Available commands:");
80 helpString.emplace_back(
"getMetadata");
81 helpString.emplace_back(
"help");
83 if (functionName ==
"getMetadata") {
84 helpString.emplace_back(
"SensorRPCData getMetadata() ");
85 helpString.emplace_back(
"Read the sensor metadata necessary to configure the MultipleAnalogSensorsClient device. ");
87 if (functionName ==
"help") {
88 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
89 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
90 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");
91 helpString.emplace_back(
"@return list of strings (one string per line)");
94 if (helpString.empty()) {
95 helpString.emplace_back(
"Command not found");
110 std::string tag = reader.
readTag();
111 bool direct = (tag ==
"__direct__");
116 if (tag ==
"getMetadata") {
131 std::string functionName;
133 functionName =
"--all";
135 auto help_strings =
help(functionName);
141 if (!writer.
writeTag(
"many", 1, 0)) {
147 for (
const auto& help_string : help_strings) {
163 std::string next_tag = reader.
readTag();
164 if (next_tag ==
"") {
167 tag.append(
"_").append(next_tag);
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
bool read(WirePortable &obj)
IDL-friendly connection writer.
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeListBegin(int tag, std::uint32_t len) const
bool writeListEnd() const
bool writeString(const std::string &tag) const