Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
207:55aabde2d4bf
Parent:
205:3c84af5f711f
Child:
208:784c46652863
--- a/src/ConfigurationHandler/ConfigurationHandler.cpp	Fri Oct 07 17:56:23 2016 +0000
+++ b/src/ConfigurationHandler/ConfigurationHandler.cpp	Mon Oct 10 12:51:32 2016 +0000
@@ -239,9 +239,29 @@
 {
     logInfo("\r%s invoked\n", __func__);
 
-    // TODO: can we delete the current object and start a new one?
+    switch (msg->control) {
+        case CONTROL_SETPOINT: {
+            // find the control in the table
+            StringSetpointMap::iterator pos;
+            pos = setpointTable.find(msg->controlFile);
+            if ( pos != setpointTable.end() ) {
+                printf("\rDEBUG: found the control!");
+                printf("\r-> %s\n", pos->second->getId().c_str());
+                int rc = pos->second->load(msg->controlFile);
+                if ( rc != true ) {
+                    logError("\rFailed to reload the setpoint control\n");
+                } else {
+                    logInfo("\rReloaded the setpoint control\n");
+                }
+            }
+            break;
+        }
+        default:
+            logError("%s: unknown control %d\n", __func__, msg->control);
+            break;
+    }
+
     return 0;
-
 }
 
 /*****************************************************************************