Skip to content

Commit 003b88f

Browse files
author
Janne Kiiskila
committed
Use SocketAddress based API
The string based get_ip_address() API is deprecated, we need to use the SocketAddress based API instead.
1 parent 0af9cdb commit 003b88f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static M2MResource* m2m_get_res;
3636
static M2MResource* m2m_put_res;
3737
static M2MResource* m2m_post_res;
3838
static M2MResource* m2m_deregister_res;
39+
static SocketAddress sa;
3940

4041
EventQueue queue(32 * EVENTS_EVENT_SIZE);
4142
Thread t;
@@ -139,8 +140,12 @@ int main(void)
139140
printf("NetworkInterface failed to connect with %d\n", status);
140141
return -1;
141142
}
142-
143-
printf("Network initialized, connected with IP %s\n\n", network->get_ip_address());
143+
status = network->get_ip_address(&sa);
144+
if (status!=0) {
145+
printf("get_ip_address failed with %d\n", status);
146+
return -2;
147+
}
148+
printf("Network initialized, connected with IP %s\n\n", sa.get_ip_address());
144149

145150
// Run developer flow
146151
printf("Start developer flow\n");

0 commit comments

Comments
 (0)