Official reference client implementation for Cumulocity SmartREST on u-blox C027.

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Vincent Wochnik

Files at this revision

API Documentation at this revision

Comitter:
xinlei
Date:
Wed Mar 04 14:02:39 2015 +0000
Parent:
80:757c3ff7b92b
Child:
82:ca7430f50b2b
Commit message:
Express mode: walk-around for stability issue.

Changed in this revision

MbedAgent.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
operation/OperationSupport.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MbedAgent.cpp	Wed Mar 04 11:14:30 2015 +0000
+++ b/MbedAgent.cpp	Wed Mar 04 14:02:39 2015 +0000
@@ -98,8 +98,8 @@
     wdt.kick(60.0);    // set a 60.0 seconds timeout on watchdog hardware timer
     while (true) {
         if (joystickDown) {
-            setLevel(A_INFO);
-            _mdm.setDebug(1);
+            setLevel(A_NONE);
+            _mdm.setDebug(-1);
             printf("***Disabled debug mode.***\r\n");
         } else if (joystickUp) {
             setLevel(A_DEBUG);
@@ -107,15 +107,10 @@
             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();
                 
--- a/main.cpp	Wed Mar 04 11:14:30 2015 +0000
+++ b/main.cpp	Wed Mar 04 14:02:39 2015 +0000
@@ -47,8 +47,8 @@
         mdm.setDebug(3);
         printf("Enable debug mode.\r\n");
     } else {
-        setLevel(A_INFO);
-        mdm.setDebug(1);
+        setLevel(A_NONE);
+        mdm.setDebug(-1);
     }        
     
     io.lcdPrint("Device Init");
@@ -108,7 +108,6 @@
             io.lcdPrint("Agent Init Failure", "Debug via serial port");
             goto error;
         }
-        
         uint8_t tries = 3;
         do {
             io.lcdPrint("Agent Run");
--- a/operation/OperationSupport.cpp	Wed Mar 04 11:14:30 2015 +0000
+++ b/operation/OperationSupport.cpp	Wed Mar 04 14:02:39 2015 +0000
@@ -185,6 +185,7 @@
             continue;
         }
         
+//        printf("Thread 1: %l, %s, %u\r\n", op.identifier, op.descriptor, op.state);
         updateOperation(op);
         ret = _executor.executeOperation(op);
         _store.markAsDone(op, ret);
@@ -203,6 +204,7 @@
         while ((!aggr.full()) && (_store.takeDone(op))) {
             ComposedRecord record;
     
+//            printf("Thread 2: %l, %s, %u\r\n", op.identifier, op.descriptor, op.state);
             IntegerValue msgId(111);
             IntegerValue operationId(op.identifier);
             if ((!record.add(msgId)) || (!record.add(operationId)) ||
@@ -296,9 +298,10 @@
         while (_client.receive(received) == SMARTREST_SUCCESS) {
             if (!operationFromRecord(received, op))
                 continue;
+//            printf("Thread 3: %l, %s, %u\r\n", op.identifier, op.descriptor, op.state);
             _store.enqueue(op);
         }
-        
+
         //TODO: error checking
         _client.stop();
     }