10 #include <yarp/os/Network.h>
11 #include <yarp/os/NetType.h>
13 #include <yarp/conf/environment.h>
23 std::string
tmp = yarp::conf::environment::get_string(
"ETH_VERBOSEWHENOK");
41 return deviceNameType +
": BOARD name_unknown (IP unknown) ";
45 return (deviceNameType +
": BOARD " + res->getProperties().boardnameString +
" (IP " + res->getProperties().ipv4addrString +
") ");
55 if(NULL == ethManager)
57 yFatal() << deviceNameType <<
" fails to instantiate ethManager";
63 eOipv4addr_t ipv4addr;
66 if(
false == ethManager->verifyEthBoardInfo(config, ipv4addr, boardIPstring, boardName))
68 yError() << deviceNameType <<
" object TheEthManager fails in parsing ETH propertiex from xml file";
72 res = ethManager->requestResource2(interface, config);
75 yError() << deviceNameType <<
":requestResource fails because could not instantiate the ethResource for BOARD " << getBoardInfo() <<
" ... unable to continue";
87 if(ethManager == NULL)
return;
89 int ret = ethManager->releaseResource2(res, interface);
92 ethManager->killYourself();
99 if(
false == res->serviceSetRegulars(category, id32vector, timeout))
101 yError() << getBoardInfo() <<
"initRegulars() fails to add its variables to regulars: cannot proceed any further";
108 yDebug() << getBoardInfo() <<
"initRegulars() added" << id32vector.size() <<
"regular rops ";
110 for (
size_t r = 0; r<id32vector.size(); r++)
112 uint32_t item = id32vector.at(r);
113 eoprot_ID2information(item, nvinfo,
sizeof(nvinfo));
114 yDebug() <<
"\t it added regular rop for" << nvinfo;
static TheEthManager * instance()
bool prerareEthService(yarp::os::Searchable &config, eth::IethResource *interface)
bool serviceSetRegulars(eOmn_serv_category_t category, vector< eOprotID32_t > &id32vector, double timeout=0.500)
void cleanup(eth::IethResource *interface)
std::string getBoardInfo(void) const
eth::TheEthManager * ethManager
embObjDevPrivData(std::string name)
eth::AbstractEthResource * res