Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
46:4cb96ab2d1c8
Parent:
30:738359dfdab1
Child:
51:66b820f203a5
--- a/src/ConfigurationHandler/Controls/SetpointControl.cpp	Mon Sep 12 14:38:39 2016 +0000
+++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp	Tue Sep 13 11:59:34 2016 +0000
@@ -13,7 +13,7 @@
 
 bool SetpointControl::load(string _controlFile)
 {
-    MbedJSONValue json_value;
+    MbedJSONValue json_value;           // JSON parsing element 
     controlFile = _controlFile;    
  
     // try to open the control file
@@ -27,28 +27,17 @@
     int bytes_read = GLOBAL_mdot->readUserFile(file, (void *)dataBuf, sizeof(dataBuf));
     if ( bytes_read != sizeof(dataBuf) ) {
         logError("%s: failed to read %d bytes from %s", __func__, sizeof(dataBuf), controlFile.c_str());
+        // we can't throw exceptions in mbed, so just return false. the calling function will
+        // destroy the object 
         return false;
     }
     
     // close the file 
     GLOBAL_mdot->closeUserFile(file);
 
+    // parse the json data 
     parse(json_value, dataBuf);
-
-    // "spcontrol": {
-    // "id": "SP",
-    // "name": "TRASAR 3DTS85",
-    // "priority":"800",
-    // "input":"i_tra1"
-    // "output":"o_r5",
-    // "prodfact":"100",
-    // "halert":"115",
-    // "lalert":"85",
-    // "hfs":"130",
-    // "lfs":"70",
-    // "tol":"5",
     
-    // parse the json data 
     id              = json_value["id"].get<string>();
     name            = json_value["name"].get<string>();
     priority        = atoi(json_value["priority"].get<string>().c_str());