Skip to content

Commit 2f0d766

Browse files
author
Antti Kauppila
authored
Merge pull request #138 from michalpasztamobica/remove_deprecated_api
Remove usage of deprecated string-based API
2 parents 8b4f789 + 1b5c2de commit 2f0d766

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

main.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ int main() {
3232
}
3333

3434
// Show the network address
35-
const char *ip = net->get_ip_address();
36-
const char *netmask = net->get_netmask();
37-
const char *gateway = net->get_gateway();
38-
printf("IP address: %s\n", ip ? ip : "None");
39-
printf("Netmask: %s\n", netmask ? netmask : "None");
40-
printf("Gateway: %s\n", gateway ? gateway : "None");
35+
SocketAddress a;
36+
net->get_ip_address(&a);
37+
printf("IP address: %s\n", a.get_ip_address() ? a.get_ip_address() : "None");
38+
net->get_netmask(&a);
39+
printf("Netmask: %s\n", a.get_ip_address() ? a.get_ip_address() : "None");
40+
net->get_gateway(&a);
41+
printf("Gateway: %s\n", a.get_ip_address() ? a.get_ip_address() : "None");
4142

4243
// Open a socket on the network interface, and create a TCP connection to ifconfig.io
4344
TCPSocket socket;

mbed-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#51d55508e8400b60af467005646c4e2164738d48
1+
https://github.com/ARMmbed/mbed-os/#64853b354fa188bfe8dbd51e78771213c7ed37f7

0 commit comments

Comments
 (0)