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)
118 mpConfig.
name = ipv4addrstring +
" (" + boardName +
")";
131 if(
false == transceiver.
init2(
this, cfgtotal, localIPv4, remIP))
133 yError() <<
"EthResource::open2() cannot init transceiver w/ HostTransceiver::init2() for BOARD" << boardName <<
"IP" << ipv4addrstring;
191bool FakeEthResource::isRunning(
void)
193 return(isInRunningMode);
200 if((uint8_t)ep >= eoprot_endpoints_numberof)
202 yError() <<
"EthResource::verifyEPprotocol() called with wrong ep = " << ep <<
": cannot proceed any further";
206 if(
true == verifiedEPprotocol[ep])
211 if(
false == verifyBoard())
217 verifiedEPprotocol[ep] =
true;
225bool FakeEthResource::verifyBoard(
void)
256 yError() <<
"FakeEthResource " << boardName <<
": should never be in CANPrintHandler";
274 isInRunningMode =
true;
286 bool ret = transceiver.
read(id32,
data);
291 if(id32 == eoprot_ID_get(eoprot_endpoint_analogsensors, eoprot_entity_as_strain, 0, eoprot_tag_as_strain_status_fullscale))
294 eOas_arrayofupto12bytes_t * fullscale = (eOas_arrayofupto12bytes_t *)
data;
295 fullscale->head.size = 6;
303 return transceiver.
write(id32, value, overrideROprotection);
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()
const eOipv4addressing_t & getLocalIPV4addressing(void)
bool write(const eOprotID32_t id32, const void *data, bool forcewriteOfReadOnly)
bool init2(AbstractEthResource *owner, yarp::os::Searchable &cfgtotal, eOipv4addressing_t &localIPaddressing, eOipv4addr_t remoteIP, uint16_t rxpktsize=maxSizeOfRXpacket)
bool read(const eOprotID32_t id32, void *data)
bool read(yarp::os::Searchable &cfgtotal, pc104Data &pc104data)
string ipv4addressingString
eOipv4addressing_t ipv4addressing
eObrd_ethtype_t boardtype
double periodmissingreport
double monitorpresence_periodofmissingreport
bool monitorpresence_enabled
double monitorpresence_timeout
boardProperties properties
eOipv4addressing_t ipv4addressing
std::string ipv4addressingstring