An example hot to register a network connection state change callback. Possible state changes are listed on the example.

Supported in Mbed OS version 5.8

Revision:
3:a0e64683327b
Parent:
0:bc6951bb0712
Child:
4:987d54985478
--- a/main.cpp	Fri Feb 23 10:02:49 2018 +0000
+++ b/main.cpp	Mon Feb 26 11:07:16 2018 +0000
@@ -33,11 +33,15 @@
     printf("Status callback example!\r\n");
 
     eth.attach(&status_callback);
+    eth.set_blocking(false);
+    
     printf("Connecting...\n");
     eth.connect();
+    
     wait(10);
+    
     printf("Disconnect\n");
     eth.disconnect();
-
-    printf("Done\n");
-}
\ No newline at end of file
+    
+    printf("Done\n");    
+}