Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Revision:
77:f6717e4eccc4
Parent:
76:b07effe83fb8
Child:
78:bf32dfe6c47f
--- a/MbedAgent.cpp	Wed Feb 25 10:06:11 2015 +0000
+++ b/MbedAgent.cpp	Tue Mar 03 14:10:09 2015 +0000
@@ -9,7 +9,7 @@
     _deviceInfo(deviceInfo),
     _deviceMemory(deviceMemory),
     _configurationProperties(_deviceConfiguration),
-    _client(MBED_AGENT_HOST, MBED_AGENT_PORT, MBED_AGENT_DEVICE_IDENTIFIER),
+    _client(MBED_AGENT_HOST, MBED_AGENT_PORT, MBED_AGENT_DEVICE_IDENTIFIER, mdm),
     _bootstrap(_client, _io, _deviceInfo, _deviceMemory),
     _integration(_client, _tpl, _deviceId, _deviceInfo),
     _configurationSynchronization(_client, _tpl, _deviceId, _deviceMemory, _deviceConfiguration, _configurationProperties),
@@ -90,16 +90,35 @@
 void MbedAgent::loop()
 {
     Watchdog wdt;
+    DigitalIn joystickUp(A2);
+    DigitalIn joystickDown(A3);
+//    DigitalIn joystickLeft(A4);
+//    AnalogIn joystickRight(A5);
+    
     wdt.kick(60.0);    // set a 60.0 seconds timeout on watchdog hardware timer
     while (true) {
-        _configurationSynchronization.run();
-        _signalQualityMeasurement.run();
-        _temperatureMeasurement.run();
-        _analogMeasurement.run();
-        _accelerationMeasurement.run();
-        _locationUpdate.run();
+        if (joystickDown) {
+            setLevel(A_INFO);
+            _mdm.setDebug(1);
+            printf("***Disabled debug mode.***\r\n");
+        } else if (joystickUp) {
+            setLevel(A_DEBUG);
+            _mdm.setDebug(3);
+            printf("***Enabled debug mode.***\r\n");
+        }
+//        _configurationSynchronization.run();
+//        _operationSupport.run();
+//        _signalQualityMeasurement.run();
+//        _operationSupport.run();
+//        _temperatureMeasurement.run();
+//        _operationSupport.run();
+//        _analogMeasurement.run();
+//        _operationSupport.run();
+//        _accelerationMeasurement.run();
+//        _operationSupport.run();
+//        _locationUpdate.run();
         _operationSupport.run();
-        
+                
 //        if ((interval = _configurationProperties.readInterval()) < 0)
 //            break;
 //