18#include <yarp/os/Time.h>
19#include <yarp/os/Network.h>
20#include <yarp/os/NetType.h>
23#include "EOropframe_hid.h"
25#include "EoProtocol.h"
26#include "EoManagement.h"
27#include "EoProtocolMN.h"
28#include "EoProtocolAS.h"
32using namespace yarp::os;
33using namespace yarp::os::impl;
44 ipv4addressing.addr = 0;
45 ipv4addressing.port = 0;
46 ipv4addrstring =
"0.0.0.0";
47 ethboardtype = eobrd_ethtype_unknown;
48 boardTypeString =
"unknown";
51 isInRunningMode =
false;
53 verifiedBoardPresence =
false;
54 verifiedBoardTransceiver =
false;
56 memset(verifiedEPprotocol, 0,
sizeof(verifiedEPprotocol));
58 usedNumberOfRegularROPs = 0;
59 memset(&boardCommStatus, 0,
sizeof(boardCommStatus));
69bool FakeEthResource::lock(
bool on)
93 properties.ipv4addr = remIP;
118 mpConfig.
name = ipv4addrstring +
" (" + boardName +
")";
128 eOipv4addressing_t localIPv4 = ethManager->getLocalIPV4addressing();
131 if(
false == transceiver.init2(
this, cfgtotal, localIPv4, remIP))
133 yError() <<
"EthResource::open2() cannot init transceiver w/ HostTransceiver::init2() for BOARD" << boardName <<
"IP" << ipv4addrstring;
192bool FakeEthResource::isRunning(
void)
194 return(isInRunningMode);
201 if((uint8_t)ep >= eoprot_endpoints_numberof)
203 yError() <<
"EthResource::verifyEPprotocol() called with wrong ep = " << ep <<
": cannot proceed any further";
207 if(
true == verifiedEPprotocol[ep])
212 if(
false == verifyBoard())
218 verifiedEPprotocol[ep] =
true;
226bool FakeEthResource::verifyBoard(
void)
257 yError() <<
"FakeEthResource " << boardName <<
": should never be in CANPrintHandler";
264 eOmn_serv_parameter_t prepared {};
267 yError() <<
"FakeEthResource::serviceVerifyActivate(): MC requires"
283 isInRunningMode =
true;
296 bool ret = transceiver.read(id32,
data);
301 if(id32 == eoprot_ID_get(eoprot_endpoint_analogsensors, eoprot_entity_as_strain, 0, eoprot_tag_as_strain_status_fullscale))
304 eOas_arrayofupto12bytes_t * fullscale = (eOas_arrayofupto12bytes_t *)
data;
305 fullscale->head.size = 6;
313 return transceiver.write(id32, value, overrideROprotection);
POSServiceConfiguration posServiceConfiguration
bool processRXpacket(const void *data, const size_t size)
bool serviceStart(eOmn_serv_category_t category, double timeout=0.500)
bool getRemoteValues(const std::vector< eOprotID32_t > &id32s, const std::vector< void * > &values, const double timeout=0.500)
bool getRemoteValue(const eOprotID32_t id32, void *value, const double timeout=0.100, const unsigned int retries=0)
const void * getUDPtransmit(eOipv4addressing_t &destination, size_t &sizeofpacket, uint16_t &numofrops)
HostTransceiver * getTransceiver()
bool serviceSetRegulars(eOmn_serv_category_t category, vector< eOprotID32_t > &id32vector, double timeout=0.500)
bool setRemoteValue(const eOprotID32_t id32, void *value)
bool serviceStop(eOmn_serv_category_t category, double timeout=0.500)
const Properties & getProperties()
bool setcheckRemoteValue(const eOprotID32_t id32, void *value, const unsigned int retries=10, const double waitbeforecheck=0.001, const double timeout=0.050)
bool open2(eOipv4addr_t remIP, yarp::os::Searchable &cfgtotal) override
bool verifyEPprotocol(eOprot_endpoint_t ep)
bool CANPrintHandler(eOmn_info_basic_t *infobasic)
bool setLocalValue(const eOprotID32_t id32, const void *value, bool overrideROprotection=false)
bool getLocalValue(const eOprotID32_t id32, void *value)
bool serviceVerifyActivate(eOmn_serv_category_t category, const eOmn_serv_parameter_t *param, double timeout=0.500)
static TheEthManager * instance()
bool read(yarp::os::Searchable &cfgtotal, pc104Data &pc104data)
double periodmissingreport
double monitorpresence_periodofmissingreport
bool monitorpresence_enabled
double monitorpresence_timeout
boardProperties properties
eOipv4addressing_t ipv4addressing
std::string ipv4addressingstring