43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method ControlBoardMsgs::getRemoteProtocolVersion");
73 return helper.helper_proto;}
84 if (remproto.protocol_version != locproto.protocol_version)
86 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
123 explicit Command(
const std::int32_t
j);
163 static constexpr const char*
s_tag{
"isJointBrakedRPC"};
167 static constexpr const char*
s_prototype{
"return_isJointBraked ControlBoardMsgs::isJointBrakedRPC(const std::int32_t j) const"};
227 static constexpr const char*
s_tag{
"setManualBrakeActiveRPC"};
231 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ControlBoardMsgs::setManualBrakeActiveRPC(const std::int32_t j, const bool active)"};
291 static constexpr const char*
s_tag{
"setAutoBrakeEnabledRPC"};
295 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ControlBoardMsgs::setAutoBrakeEnabledRPC(const std::int32_t j, const bool enabled)"};
314 explicit Command(
const std::int32_t
j);
354 static constexpr const char*
s_tag{
"getAutoBrakeEnabledRPC"};
358 static constexpr const char*
s_prototype{
"return_getAutoBrakeEnabled ControlBoardMsgs::getAutoBrakeEnabledRPC(const std::int32_t j) const"};
412 static constexpr const char*
s_tag{
"getAxesRPC"};
416 static constexpr const char*
s_prototype{
"return_getAxes ControlBoardMsgs::getAxesRPC() const"};
435 explicit Command(
const std::int32_t
j);
475 static constexpr const char*
s_tag{
"getDesiredVelocityOneRPC"};
479 static constexpr const char*
s_prototype{
"return_getDesiredVelocityOne ControlBoardMsgs::getDesiredVelocityOneRPC(const std::int32_t j) const"};
533 static constexpr const char*
s_tag{
"getDesiredVelocityAllRPC"};
537 static constexpr const char*
s_prototype{
"return_getDesiredVelocityAll ControlBoardMsgs::getDesiredVelocityAllRPC() const"};
556 explicit Command(
const std::vector<std::int32_t>&
j);
571 std::vector<std::int32_t>
j{};
596 static constexpr const char*
s_tag{
"getDesiredVelocityGroupRPC"};
600 static constexpr const char*
s_prototype{
"return_getDesiredVelocityGroup ControlBoardMsgs::getDesiredVelocityGroupRPC(const std::vector<std::int32_t>& j) const"};
631 return write(writer);
646 if (!writeTag(writer)) {
649 if (!writeArgs(writer)) {
673 if (!readTag(reader)) {
676 if (!readArgs(reader)) {
715 return write(writer);
730 if (!writer.
write(return_helper)) {
746 if (!reader.
read(return_helper)) {
786 return write(writer);
801 if (!writeTag(writer)) {
804 if (!writeArgs(writer)) {
831 if (!readTag(reader)) {
834 if (!readArgs(reader)) {
881 return write(writer);
893 if (!writer.
write(return_helper)) {
906 if (!reader.
read(return_helper)) {
946 return write(writer);
961 if (!writeTag(writer)) {
964 if (!writeArgs(writer)) {
991 if (!readTag(reader)) {
994 if (!readArgs(reader)) {
1041 return write(writer);
1047 return read(reader);
1053 if (!writer.
write(return_helper)) {
1066 if (!reader.
read(return_helper)) {
1105 return write(writer);
1115 return read(reader);
1120 if (!writeTag(writer)) {
1123 if (!writeArgs(writer)) {
1147 if (!readTag(reader)) {
1150 if (!readArgs(reader)) {
1189 return write(writer);
1195 return read(reader);
1204 if (!writer.
write(return_helper)) {
1220 if (!reader.
read(return_helper)) {
1249 return write(writer);
1259 return read(reader);
1264 if (!writeTag(writer)) {
1267 if (!writeArgs(writer)) {
1288 if (!readTag(reader)) {
1291 if (!readArgs(reader)) {
1322 return write(writer);
1328 return read(reader);
1337 if (!writer.
write(return_helper)) {
1353 if (!reader.
read(return_helper)) {
1392 return write(writer);
1402 return read(reader);
1407 if (!writeTag(writer)) {
1410 if (!writeArgs(writer)) {
1434 if (!readTag(reader)) {
1437 if (!readArgs(reader)) {
1476 return write(writer);
1482 return read(reader);
1491 if (!writer.
write(return_helper)) {
1507 if (!reader.
read(return_helper)) {
1536 return write(writer);
1546 return read(reader);
1551 if (!writeTag(writer)) {
1554 if (!writeArgs(writer)) {
1575 if (!readTag(reader)) {
1578 if (!readArgs(reader)) {
1609 return write(writer);
1615 return read(reader);
1624 if (!writer.
write(return_helper)) {
1640 if (!reader.
read(return_helper)) {
1679 return write(writer);
1689 return read(reader);
1694 if (!writeTag(writer)) {
1697 if (!writeArgs(writer)) {
1716 if (!writer.
writeBlock(
reinterpret_cast<const char*
>(j.data()), j.size() *
sizeof(std::int32_t))) {
1727 if (!readTag(reader)) {
1730 if (!readArgs(reader)) {
1760 if constexpr (expected_tag != 0) {
1761 if (_csize != 0 && _etype.
code != expected_tag) {
1766 if (_csize != 0 && !reader.
readBlock(
reinterpret_cast<char*
>(j.data()), j.size() *
sizeof(std::int32_t))) {
1780 return write(writer);
1786 return read(reader);
1795 if (!writer.
write(return_helper)) {
1811 if (!reader.
read(return_helper)) {
1826 yarp().setOwner(*
this);
1831 if (!
yarp().canWrite()) {
1835 bool ok =
yarp().write(helper, helper);
1841 if (!
yarp().canWrite()) {
1845 bool ok =
yarp().write(helper, helper);
1851 if (!
yarp().canWrite()) {
1855 bool ok =
yarp().write(helper, helper);
1861 if (!
yarp().canWrite()) {
1865 bool ok =
yarp().write(helper, helper);
1871 if (!
yarp().canWrite()) {
1875 bool ok =
yarp().write(helper, helper);
1881 if (!
yarp().canWrite()) {
1885 bool ok =
yarp().write(helper, helper);
1891 if (!
yarp().canWrite()) {
1895 bool ok =
yarp().write(helper, helper);
1901 if (!
yarp().canWrite()) {
1905 bool ok =
yarp().write(helper, helper);
1912 bool showAll = (functionName ==
"--all");
1913 std::vector<std::string> helpString;
1915 helpString.emplace_back(
"*** Available commands:");
1924 helpString.emplace_back(
"help");
1950 if (functionName ==
"help") {
1951 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
1952 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
1953 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");
1954 helpString.emplace_back(
"@return list of strings (one string per line)");
1957 if (helpString.empty()) {
1958 helpString.emplace_back(
"Command not found");
1966 constexpr size_t max_tag_len = 1;
1976 std::string tag = reader.
readTag(1);
1977 bool direct = (tag ==
"__direct__");
1981 while (tag_len <= max_tag_len && !reader.
isError()) {
1982 if(tag ==
"getRemoteProtocolVersion") {
1989 auto proto = getLocalProtocolVersion();
1995 if (!writer.
write(proto)) {
2122 if (tag ==
"help") {
2123 std::string functionName;
2125 functionName =
"--all";
2127 auto help_strings = help(functionName);
2133 if (!writer.
writeTag(
"many", 1, 0)) {
2139 for (
const auto& help_string : help_strings) {
2155 std::string next_tag = reader.
readTag(1);
2156 if (next_tag.empty()) {
2159 tag.append(
"_").append(next_tag);
2160 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
~Command() override=default
bool readTag(yarp::os::idl::WireReader &reader)
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_getAutoBrakeEnabled return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr const char * s_prototype
static constexpr const char * s_help
return_getAutoBrakeEnabled(*)(const std::int32_t) funcptr_t
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void call(ControlBoardMsgs *ptr)
static constexpr size_t s_tag_len
static constexpr size_t s_cmd_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_tag
ControlBoardMsgs_getAutoBrakeEnabledRPC_helper()=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Command() override=default
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_getAxes return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
static constexpr const char * s_tag
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_getAxes(*)() funcptr_t
static constexpr size_t s_reply_len
static constexpr const char * s_help
static constexpr const char * s_prototype
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void call(ControlBoardMsgs *ptr)
static constexpr size_t s_cmd_len
ControlBoardMsgs_getAxesRPC_helper()=default
static constexpr size_t s_tag_len
~Command() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
return_getDesiredVelocityAll return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
void call(ControlBoardMsgs *ptr)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_tag_len
static constexpr size_t s_cmd_len
static constexpr const char * s_prototype
static constexpr const char * s_tag
static constexpr size_t s_reply_len
static constexpr const char * s_help
return_getDesiredVelocityAll(*)() funcptr_t
ControlBoardMsgs_getDesiredVelocityAllRPC_helper()=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
std::vector< std::int32_t > j
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_getDesiredVelocityGroup return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ControlBoardMsgs_getDesiredVelocityGroupRPC_helper()=default
static constexpr size_t s_tag_len
void call(ControlBoardMsgs *ptr)
return_getDesiredVelocityGroup(*)(const std::vector< std::int32_t > &) funcptr_t
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_help
static constexpr const char * s_prototype
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_cmd_len
static constexpr const char * s_tag
~Command() override=default
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
return_getDesiredVelocityOne return_helper
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_prototype
static constexpr const char * s_help
static constexpr size_t s_reply_len
ControlBoardMsgs_getDesiredVelocityOneRPC_helper()=default
static constexpr size_t s_tag_len
static constexpr size_t s_cmd_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void call(ControlBoardMsgs *ptr)
return_getDesiredVelocityOne(*)(const std::int32_t) funcptr_t
static constexpr const char * s_tag
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::os::ApplicationNetworkProtocolVersion helper_proto
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ControlBoardMsgs_getRemoteProtocolVersion_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Command() override=default
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
return_isJointBraked return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_isJointBraked(*)(const std::int32_t) funcptr_t
static constexpr const char * s_prototype
ControlBoardMsgs_isJointBrakedRPC_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void call(ControlBoardMsgs *ptr)
static constexpr const char * s_tag
static constexpr size_t s_cmd_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_tag_len
static constexpr const char * s_help
static constexpr size_t s_reply_len
~Command() override=default
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::dev::ReturnValue return_helper
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_help
static constexpr size_t s_tag_len
static constexpr const char * s_prototype
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::dev::ReturnValue(*)(const std::int32_t, const bool) funcptr_t
void call(ControlBoardMsgs *ptr)
static constexpr size_t s_cmd_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ControlBoardMsgs_setAutoBrakeEnabledRPC_helper()=default
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
yarp::dev::ReturnValue return_helper
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ControlBoardMsgs_setManualBrakeActiveRPC_helper()=default
static constexpr const char * s_tag
void call(ControlBoardMsgs *ptr)
static constexpr size_t s_tag_len
static constexpr size_t s_reply_len
static constexpr const char * s_help
static constexpr size_t s_cmd_len
yarp::dev::ReturnValue(*)(const std::int32_t, const bool) funcptr_t
static constexpr const char * s_prototype
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual return_getDesiredVelocityGroup getDesiredVelocityGroupRPC(const std::vector< std::int32_t > &j) const
virtual yarp::dev::ReturnValue setManualBrakeActiveRPC(const std::int32_t j, const bool active)
virtual bool checkProtocolVersion()
virtual return_getDesiredVelocityAll getDesiredVelocityAllRPC() const
virtual yarp::dev::ReturnValue setAutoBrakeEnabledRPC(const std::int32_t j, const bool enabled)
virtual return_getAxes getAxesRPC() const
virtual return_getAutoBrakeEnabled getAutoBrakeEnabledRPC(const std::int32_t j) const
virtual return_isJointBraked isJointBrakedRPC(const std::int32_t j) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual return_getDesiredVelocityOne getDesiredVelocityOneRPC(const std::int32_t j) const
short int protocol_version
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.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
void readListBegin(yarp::os::idl::WireState &nstate, size_t &len)
bool readI32(std::int32_t &x)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool readBlock(char *const data, size_t len)
bool read(WirePortable &obj)
IDL-friendly connection writer.
bool writeBool(bool x, bool skip_tag=false) const
bool write(const WirePortable &obj) const
bool writeI32(std::int32_t x, bool skip_tag=false) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeBlock(const char *data, size_t len) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeListBegin(int tag, size_t len) const
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.
#define YARP_VERSION_PATCH
#define YARP_VERSION_MAJOR
#define YARP_VERSION_MINOR