Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
220:dbe21411f962
Parent:
217:d5a2ff093319
Child:
221:2a5e9902003c
--- a/src/ConfigurationHandler/ConfigurationHandler.cpp	Tue Oct 11 18:39:43 2016 +0000
+++ b/src/ConfigurationHandler/ConfigurationHandler.cpp	Fri Oct 14 13:32:47 2016 +0000
@@ -8,11 +8,13 @@
 #include "global.h"
 #include "SetpointControl.h"
 #include "TimerControl.h"
+#include "CompositeControl.h"
 #include <algorithm>
 
 StringSetpointMap       setpointTable;          // setpoint control object table
 StringVectorTimerMap    timerTable;             // timer control object table
 StringManualMap         manualTable;            // manual control object table
+StringCompositeMap      compositeTable;         // composite control object table
 
 // local function prototypes
 static int loadPersistentControls(void);
@@ -109,6 +111,14 @@
             pos->second->display();
         }
     }
+    
+    if ( !compositeTable.empty() ) {
+        printf("\r\n");
+        StringCompositeMap::iterator pos;
+        for ( pos = compositeTable.begin(); pos != compositeTable.end(); ++pos ) {
+            pos->second->display();
+        }
+    }
 }
 
 /*****************************************************************************
@@ -218,8 +228,19 @@
             }
             break;
         }
+        case CONTROL_COMPOSITE: {
+            CompositeControl *compositeControl = new CompositeControl;
+            bool rc = compositeControl->load(msg->controlFile);
+            if ( rc != true ) {
+                logError("%s: failed to load %s\n", __func__, msg->controlFile);
+                delete compositeControl;
+            } else {
+                compositeTable[msg->controlFile] = compositeControl;
+                // add this control to the table
+            }
+            break;
+        }
         case CONTROL_PID:
-        case CONTROL_COMPOSITE:
         default:
             logInfo("\r%s: control type %d not implemented yet...\n",
                     __func__, msg->control);