Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
19:9bc8fabeddfa
Parent:
13:c80c283f9db2
Child:
20:653923c2f37a
--- a/src/ConfigurationHandler/ConfigurationHandler.cpp	Wed Sep 07 19:04:16 2016 +0000
+++ b/src/ConfigurationHandler/ConfigurationHandler.cpp	Wed Sep 07 19:40:17 2016 +0000
@@ -130,16 +130,33 @@
 
     switch (msg->control) {
         case CONTROL_SETPOINT: {
-            SetpointControl *setpointControl = new SetpointControl(msg->controlFile);
-            setpointTable[msg->controlFile] = setpointControl;
+            SetpointControl *setpointControl = new SetpointControl();
+            bool rc = setpointControl->Load(msg->controlFile);
+            if ( rc != true ) {
+                logError("%s: failed to load %s\n", __func__, msg->controlFile);
+                delete setpointControl;
+            } else {
+                setpointTable[msg->controlFile] = setpointControl;
+            }
             break;
         }
         case CONTROL_TIMER: {
-            TimerControl *timerControl = new TimerControl(msg->controlFile);
-            timerTable[msg->controlFile] = timerControl;
+            TimerControl *timerControl = new TimerControl();
+            bool rc = timerControl->Load(msg->controlFile);
+            if ( rc != true ) {
+                logError("%s: failed to load %s\n", __func__, msg->controlFile);
+                delete timerControl;
+            } else {
+                timerTable[msg->controlFile] = timerControl;
+            }
             break;
         }
+        case CONTROL_PID:
+        case CONTROL_MANUAL:
+        case CONTROL_COMPOSITE:
         default:
+            printf("\r%s: control type %d not implemented yet...\n", 
+                __func__, msg->control);
             break;
     }
     return 0;
@@ -178,7 +195,6 @@
                 delete (pos->second);
                 setpointTable.erase(pos);
             }
-
             break;
         }
         case CONTROL_TIMER: {