1 #ifndef _ots_NetworkDevice_h_
2 #define _ots_NetworkDevice_h_
4 #include <netinet/in.h>
18 int initSocket(std::string socketPort =
"");
19 int initSocket(
unsigned int socketPort);
21 int ping(
int socketDescriptor);
22 int send(
int socketDescriptor,
const std::string& msg);
23 int receive(
int socketDescriptor, std::string& msg);
24 int listen(
int socketDescriptor, std::string& msg);
25 std::string getFullIPAddress(std::string partialIpAddress);
26 std::string getInterfaceName(std::string ipAddress);
27 std::string getMacAddress(std::string interfaceName);
35 struct sockaddr_in deviceAddress_;
37 std::map<int, int> openSockets_;
42 FirstSocketPort = 10000,
43 LastSocketPort = 15000
46 int getInterface(std::string partialIpAddress);
48 struct ifaddrs* communicationInterface_;