23#ifndef _THEETHMANAGER_H_
24#define _THEETHMANAGER_H_
38#include <ace/config.h>
39#include <ace/Thread.h>
40#include <ace/SOCK_Dgram_Bcast.h>
41#include "ace/OS_main.h"
42#include "ace/OS_NS_string.h"
43#include "ace/OS_NS_sys_socket.h"
46#include <yarp/os/Bottle.h>
47#include <yarp/os/Time.h>
48#include <yarp/os/Port.h>
57#include "EoProtocol.h"
61#include <yarp/os/LogStream.h>
64using namespace yarp::os;
113 bool verifyEthBoardInfo(yarp::os::Searchable &cfgtotal, eOipv4addr_t &boardipv4,
string boardipv4string,
string boardname);
126 bool Reception(eOipv4addr_t from, uint64_t*
data, ssize_t size);
136 const string &
getName(eOipv4addr_t ipv4);
138 int sendPacket(
const void *udpframe,
size_t len,
const eOipv4addressing_t &toaddressing);
140 eOipv4addr_t
toipv4addr(
const ACE_INET_Addr &aceinetaddr);
142 ACE_INET_Addr
toaceinet(
const eOipv4addressing_t &ipv4addressing);
147 bool isCommunicationInitted(
void);
149 bool createCommunicationObjects(
const eOipv4addressing_t &localaddress,
int txrate,
int rxrate);
151 bool initCommunication(yarp::os::Searchable &cfgtotal);
153 bool stopCommunicationThreads(
void);
157 bool lockTX(
bool on);
158 bool lockRX(
bool on);
159 bool lockTXRX(
bool on);
164 void initEOYsystem(
void);
167 static std::mutex managerSem;
169 static std::mutex txSem;
170 static std::mutex rxSem;
177 eOipv4addressing_t ipv4local;
179 bool communicationIsInitted;
184 ACE_SOCK_Dgram* UDP_socket;
185 bool embBoardsConnected;
int releaseResource2(eth::AbstractEthResource *ethresource, IethResource *interface)
bool verifyEthBoardInfo(yarp::os::Searchable &cfgtotal, eOipv4addr_t &boardipv4, string boardipv4string, string boardname)
int sendPacket(const void *udpframe, size_t len, const eOipv4addressing_t &toaddressing)
eOipv4addr_t toipv4addr(const ACE_INET_Addr &aceinetaddr)
eth::AbstractEthResource * getEthResource(eOipv4addr_t ipv4)
IethResource * getInterface(eOipv4addr_t ipv4, eOprotID32_t id32)
static bool killYourself()
eth::EthBoards * ethBoards
bool Reception(eOipv4addr_t from, uint64_t *data, ssize_t size)
const string & getName(eOipv4addr_t ipv4)
static TheEthManager * instance()
ACE_INET_Addr toaceinet(const eOipv4addressing_t &ipv4addressing)
eth::AbstractEthResource * requestResource2(IethResource *interface, yarp::os::Searchable &cfgtotal)
int getNumberOfResources(void)
const eOipv4addressing_t & getLocalIPV4addressing(void)