YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeDevice_nwc_yarp.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7#include <yarp/os/Log.h>
9#include <yarp/os/LogStream.h>
10
11namespace
12{
13 YARP_LOG_COMPONENT(FAKEDEVICE_NWC_YARP, "yarp.device.FakeDevice_nwc_yarp")
14}
15
17{
19 {
20 yCError(FAKEDEVICE_NWC_YARP, "Cannot open rpc port, check network");
21 }
22
23 bool ok = false;
24
26
27 if (!ok)
28 {
29 yCError(FAKEDEVICE_NWC_YARP, "open() error could not connect to %s", m_remote.c_str());
30 return false;
31 }
32
34 {
35 yCError(FAKEDEVICE_NWC_YARP, "Cannot attach the RPC port as client");
36 }
37
38 //Check the protocol version
39 if (!m_thrift_RPC.checkProtocolVersion()) { return false; }
40
41 yCDebug(FAKEDEVICE_NWC_YARP) << "Opening of NWC successful";
42
43 return true;
44}
45
47{
49 return true;
50}
51
bool ret
yarp::dev::ReturnValue doSomething()
A method for testing purposes.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
const std::string m_remote
bool close() override
Close the DeviceDriver.
const std::string m_local
yarp::os::Port m_rpc_port_to_server
virtual yarp::dev::ReturnValue doSomethingRPC()
virtual bool checkProtocolVersion()
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Definition Network.cpp:682
void close() override
Stop port activity.
Definition Port.cpp:363
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Definition Port.cpp:79
A base class for nested structures that can be searched.
Definition Searchable.h:31
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition Wire.h:28
#define yCError(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)