Cumulocity Official / Mbed 2 deprecated MbedSmartRestMain Featured

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Vincent Wochnik

Revision:
63:010bbbb4732a
Parent:
62:86a04c5bda18
--- a/operation/OperationStore.cpp	Wed Oct 29 21:09:29 2014 +0000
+++ b/operation/OperationStore.cpp	Thu Oct 30 11:58:03 2014 +0000
@@ -49,6 +49,25 @@
     _mutex.unlock();    
     return false;
 }
+
+bool OperationStore::hasPending()
+{
+    size_t n;
+    Operation *tmp;
+
+    _mutex.lock();
+    for (n = 0; n < _count; n++) {
+        tmp = get(n);
+        if (tmp->state != OPERATION_PENDING)
+            continue;
+        
+        _mutex.unlock();
+        return true;
+    }
+
+    _mutex.unlock();    
+    return false;
+}
     
 bool OperationStore::markAsDone(Operation& operation, bool successful)
 {