Simple Mbed Cloud client application using features of K64 & K66 including Ethernet and SD Card

Fork of mbed-cloud-example_K64_K66 by Mac Lobdell

DEPRECATED

This example application is not maintained and not recommended. It uses an old version of Mbed OS, Pelion DM, and Arm toolchain. It doesn't work with Mbed Studio.

Please use: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-pelion/

Revision:
6:254a7e7fbef1
Parent:
5:c18fab181ede
Child:
8:ace9e5de6491
--- a/main.cpp	Wed Feb 14 17:26:42 2018 -0600
+++ b/main.cpp	Thu Feb 15 10:14:35 2018 -0600
@@ -111,9 +111,6 @@
         printf("IP address %s\n", ip_addr);
     }
 
-    // Placeholder for callback to update local resource when GET comes.
-    timer.attach(&button_press, 5.0);
-
     SimpleMbedCloudClient mbedClient(&net);
     // Save pointer to mbedClient so that other functions can access it.
     client = &mbedClient;
@@ -144,6 +141,14 @@
 
     mbedClient.register_and_connect();
 
+    // Wait for client to finish registering
+    while (!mbedClient.is_client_registered()) {
+        wait_ms(100);
+    }
+
+    // Placeholder for callback to update local resource when GET comes.
+    timer.attach(&button_press, 5.0);
+
     // Check if client is registering or registered, if true sleep and repeat.
     while (mbedClient.is_register_called()) {
         static int button_count = 0;