Simple Mbed Cloud client application using features of K64F including Wi-Fi and SD Card

Fork of mbed-cloud-example_GR-LYCHEE by Renesas

Revision:
6:254a7e7fbef1
Parent:
5:c18fab181ede
Child:
9:9fade4bb2774
--- 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;