32 yCError(ROBOTDESCRIPTIONSERVER,
"open(): Invalid local name");
41 yCError(ROBOTDESCRIPTIONSERVER,
"open(): Could not open rpc port %s, check network", local_rpc.c_str());
52 for (
int i = 0; i < p.
size(); i++)
54 yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getOptions().toString();
55 yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getValue(
"device").toString();
56 yCTrace(ROBOTDESCRIPTIONSERVER) << p[i]->poly->getValue(
"name").toString();
58 dev.
device_name = p[i]->poly->getValue(
"name").toString();
59 dev.
device_type = p[i]->poly->getValue(
"device").toString();
60 if (this->add_device(dev) ==
false)
62 yCError(ROBOTDESCRIPTIONSERVER) <<
"attachAll(): Something strange happened here";
89 yCWarning(ROBOTDESCRIPTIONSERVER) <<
"add_device(): Device" << dev.
device_name <<
"already exists, skipping";
119 bool ok = in.
read(connection);
152 if (m_robot_device.device_type == type)
163 yCError(ROBOTDESCRIPTIONSERVER,
"Invalid vocab received");
175 bool b_rem = this->remove_device(dev);
178 yCError(ROBOTDESCRIPTIONSERVER) <<
"remove_device failed";
189 yCError(ROBOTDESCRIPTIONSERVER,
"Invalid vocab received");
200 bool b_add = this->add_device(desc);
203 yCError(ROBOTDESCRIPTIONSERVER) <<
"add_device failed";
214 yCError(ROBOTDESCRIPTIONSERVER,
"Invalid vocab received");
220 yCError(ROBOTDESCRIPTIONSERVER,
"Invalid vocab received");
226 yCError(ROBOTDESCRIPTIONSERVER,
"Invalid vocab received");
237 if (returnToSender !=
nullptr)
239 out.
write(*returnToSender);
constexpr yarp::conf::vocab32_t VOCAB_OK
constexpr yarp::conf::vocab32_t VOCAB_FAILED
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_SET
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DEVICE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DELETE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DESCRIPTION
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_BY_TYPE
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_ALL
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_GET
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool detachAll() override
Detach the object (you must have first called attach).
std::mutex m_external_mutex
std::mutex m_internal_mutex
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::os::Port m_rpc_port
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
bool close() override
Close the DeviceDriver.
std::vector< yarp::dev::DeviceDescription > m_robot_devices
A simple collection of objects that can be described and transmitted in a portable way.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void clear()
Empties the bottle of any objects it contains.
bool write(ConnectionWriter &writer) const override
Output a representation of the bottle to a network connection.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
An interface for reading from a network connection.
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
An interface for writing to a network connection.
void setReader(PortReader &reader) override
Set an external reader for port data.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A base class for nested structures that can be searched.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
virtual std::string asString() const
Get string value.
#define yCError(component,...)
#define yCTrace(component,...)
#define yCWarning(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.