MBED_DEMOS / Mbed 2 deprecated mbed_mqtt_endpoint_ublox_ethernet

Dependencies:   C027 C12832 EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed

Revision:
8:45f9a920e82c
Parent:
2:90a84a216c58
Child:
9:ff877db53cfd
--- a/EmulatedResourceFactory.cpp	Wed Feb 26 18:59:08 2014 +0000
+++ b/EmulatedResourceFactory.cpp	Wed Feb 26 21:29:27 2014 +0000
@@ -56,4 +56,20 @@
     this->createResource("/sens/temp","23.2");
     this->createResource("/sens/V","3.2");
     this->createResource("/gps/loc","65.017210,25.492411");
- } 
\ No newline at end of file
+ } 
+ 
+ // set a resource value (AND trigger the Emulated actions if registered)
+ bool EmulatedResourceFactory::setResourceValue(char *name, char *value) {
+     // set the resource value
+     bool success = ((ResourceFactory *)this)->setResourceValue(name,value);
+     if (success) {
+         // invoke an action if registered
+         EmulatedCallbackPointer cb = (EmulatedCallbackPointer)this->getCallbackPointer(name);
+         if (cb != NULL) {
+             // invoke the callback
+             this->logger()->log("Invoking Action...");
+             cb();
+         }
+     }
+     return success;
+ }
\ No newline at end of file