Dreamforce 2013 MiniHack Thermostat Challenge

Dependencies:   C12832_lcd EthernetInterface-ansond-patched HTTPClient-thermostat-remotes LM75B MMA7660 SocketIO WebSocketClient-ThermostatDemo mbed-rtos mbed picojson

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Sun Nov 10 16:28:40 2013 +0000
Parent:
1:4c7d9aee324f
Child:
3:399f01802514
Commit message:
updates

Changed in this revision

HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
SocketIO.lib Show annotated file Show diff for this revision Revisions of this file
Thermostat.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/HTTPClient.lib	Tue Nov 05 22:12:13 2013 +0000
+++ b/HTTPClient.lib	Sun Nov 10 16:28:40 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/donatien/code/HTTPClient/#be61104f4e91
+http://mbed.org/users/ansond/code/HTTPClient-thermostat-remotes/#56ed7ad985da
--- a/SocketIO.lib	Tue Nov 05 22:12:13 2013 +0000
+++ b/SocketIO.lib	Sun Nov 10 16:28:40 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ansond/code/SocketIO/#997b8c5d2d46
+http://mbed.org/users/ansond/code/SocketIO/#b32005b69b5c
--- a/Thermostat.cpp	Tue Nov 05 22:12:13 2013 +0000
+++ b/Thermostat.cpp	Sun Nov 10 16:28:40 2013 +0000
@@ -360,6 +360,29 @@
         
         // announce our position
         this->updateCoordinates();
+        
+        // if not connected... reconnect
+        if (!socketio.is_connected()){
+            // announce
+            this->display("Re-connecting...");
+            this->display_lcd("Re-connecting...");
+            
+            // re-connect
+            if (this->connectWebSocketService()) {
+                // announce
+                this->display("Reconnect success");
+                this->display_lcd("Reconnect: SUCCESS");
+                this->turnRGBLEDGreen();
+                this->resetAllLEDs();
+            }
+            else {
+                // announce
+                this->display("Reconnect failure");
+                this->display_lcd("Reconnect: FAILED");
+                this->gracefullyDisconnect();
+                this->turnRGBLEDRed();
+            }
+        }
                 
         // check and react to the joystick button press
         if (joystick_pressed) {