GDP group 24 node core

Dependencies:   EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue

Revision:
27:61e67ab47da5
Parent:
26:172b585fbb10
Child:
28:9c8d472c44b7
--- a/main.cpp	Wed Jan 28 20:22:48 2015 +0000
+++ b/main.cpp	Wed Jan 28 20:40:15 2015 +0000
@@ -238,12 +238,14 @@
         pc.printf("\r\n");
     #endif
     sdcard sd = sdcard();
+    h.connect();
     
     //commissioning button
     commissioningInput.fall(commissioningFall);
     commissioningInput.rise(commissioningRise);
     
     //check if local node is basenode
+    isBasenode = h.isEthernetConnected();
     #ifdef DEBUG
         pc.printf("[MAIN] Basenode status: %i\r\n", isBasenode);
     #endif
@@ -251,9 +253,7 @@
     getLocalAddress();
     
     if (isBasenode)
-    {
-        h.connect();
-        
+    {   
         string timestampStr = h.get("time.bitnode.co.uk", 80, "/");
         time_t timestamp = atoi(timestampStr.c_str());