Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 169ad75

Browse files
author
Antti Yli-Tokola
committed
Merge pull request #43 from ARMmbed/checks
add some prints
2 parents 5c49491 + 0f6a2f6 commit 169ad75

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

source/main.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,18 @@ void app_start(int /*argc*/, char* /*argv*/[]) {
316316
// This sets up the network interface configuration which will be used
317317
// by LWM2M Client API to communicate with mbed Device server.
318318
eth.init(); //Use DHCP
319-
eth.connect();
319+
if (eth.connect() == 0) {
320+
output.printf("Connected!\r\n");
321+
}
322+
else {
323+
output.printf("Failed to form a connection!\r\n");
324+
}
325+
326+
if (lwipv4_socket_init() != 0) {
327+
output.printf("Error on lwipv4_socket_init!\r\n");
328+
}
320329

321-
lwipv4_socket_init();
322-
output.printf("IP address %s\r\n", eth.getIPAddress());
330+
output.printf("IP address is %s\r\n", eth.getIPAddress());
323331
output.printf("Device name %s\r\n", MBED_ENDPOINT_NAME);
324332

325333
// On press of SW3 button on K64F board, example application

0 commit comments

Comments
 (0)