|
1 | 1 | // ----------------------------------------------------------------------------
|
2 |
| -// Copyright 2016-2019 ARM Ltd. |
| 2 | +// Copyright 2016-2020 ARM Ltd. |
3 | 3 | //
|
4 | 4 | // SPDX-License-Identifier: Apache-2.0
|
5 | 5 | //
|
@@ -36,6 +36,7 @@ static M2MResource* m2m_get_res;
|
36 | 36 | static M2MResource* m2m_put_res;
|
37 | 37 | static M2MResource* m2m_post_res;
|
38 | 38 | static M2MResource* m2m_deregister_res;
|
| 39 | +static SocketAddress sa; |
39 | 40 |
|
40 | 41 | EventQueue queue(32 * EVENTS_EVENT_SIZE);
|
41 | 42 | Thread t;
|
@@ -139,8 +140,12 @@ int main(void)
|
139 | 140 | printf("NetworkInterface failed to connect with %d\n", status);
|
140 | 141 | return -1;
|
141 | 142 | }
|
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()); |
144 | 149 |
|
145 | 150 | // Run developer flow
|
146 | 151 | printf("Start developer flow\n");
|
@@ -224,7 +229,7 @@ int main(void)
|
224 | 229 | } else if (in_char == 'r') {
|
225 | 230 | (void) fcc_storage_delete(); // When 'r' is pressed, erase storage and reboot the board.
|
226 | 231 | printf("Storage erased, rebooting the device.\n\n");
|
227 |
| - wait(1); |
| 232 | + ThisThread::sleep_for(1*1000); |
228 | 233 | NVIC_SystemReset();
|
229 | 234 | } else if (in_char > 0 && in_char != 0x03) { // Ctrl+C is 0x03 in Mbed OS and Linux returns negative number
|
230 | 235 | value_increment(); // Simulate button press
|
|
0 commit comments