From 517f0509ca9bd61c37b62ac5eabdb4cf2eb0dd9a Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Thu, 29 Sep 2016 09:50:11 +0100 Subject: [PATCH] IPStackInterface - add ip address Currently only for IPv4. lwip was updated to accept 2 arguments for getting the ip address (buffer and length). --- features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp | 2 +- features/net/network-socket/IPStackInterface.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp b/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp index 76abe5694d..d6550e0191 100644 --- a/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp +++ b/features/net/FEATURE_IPV4/lwip-interface/LWIPIPStack.cpp @@ -37,5 +37,5 @@ const char * IPStackInterface::get_mac_address() const char * IPStackInterface::get_ip_address() { - return lwip_get_ip_address(); + return lwip_get_ip_address(_ip_address, sizeof(_ip_address)); } diff --git a/features/net/network-socket/IPStackInterface.h b/features/net/network-socket/IPStackInterface.h index a407c7448d..2a94d94415 100644 --- a/features/net/network-socket/IPStackInterface.h +++ b/features/net/network-socket/IPStackInterface.h @@ -52,6 +52,8 @@ public: * @return IP address in "10.11.12.13" form */ virtual const char *get_ip_address(); +private: + char _ip_address[16]; //IPv4 }; #endif /* IP_STACK_INTERFACE_H */