Add a new function to set TTL/Hops of SensorNetwork(UDP and UDP6) #175

Parameters to set them in the gateway.conf,
MulticastTTL=1 for UDP
GatewayUDP6Hops=1 for UDP6

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2020-02-11 18:30:33 +09:00
parent 768123b76f
commit b8129d6781
7 changed files with 48 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ public:
UDPPort6();
virtual ~UDPPort6();
int open(const char* ipAddress, uint16_t uniPortNo, const char* broadcastAddr, const char* interfaceName);
int open(const char* ipAddress, uint16_t uniPortNo, const char* broadcastAddr, const char* interfaceName, unsigned int ttl);
void close(void);
int unicast(const uint8_t* buf, uint32_t length, SensorNetAddress* sendToAddr);
int broadcast(const uint8_t* buf, uint32_t length);
@@ -84,7 +84,7 @@ private:
SensorNetAddress _clientAddr;
uint16_t _uniPortNo;
bool _disconReq;
unsigned int _ttl;
};
/*===========================================