mbed Connector Interface simplification API on top of mbed-client

Fork of mbedConnectorInterfaceV3 by Doug Anson

NOTE:

This repo has been replaced with https://github.com/ARMmbed/mbedConnectorInterface. No further updates will occur with this repo. Please use the github repo instead. Thanks!

Revision:
14:d9ce4e56684e
Parent:
13:9edad7677211
Child:
30:db367366b1f5
--- a/source/DeviceManagementResponder.cpp	Wed Jun 08 22:32:08 2016 +0000
+++ b/source/DeviceManagementResponder.cpp	Thu Jun 09 19:05:18 2016 +0000
@@ -35,8 +35,7 @@
      this->m_reset_responder_fn = NULL;
      this->m_fota_invocation_fn = NULL;
      this->m_fota_manifest = NULL;
-     this->m_state_resource = NULL;
-     this->m_result_resource = NULL;
+     this->m_firmware_composite_resource = NULL;
 }
 
 // copy constructor
@@ -48,8 +47,7 @@
     this->m_reset_responder_fn = responder.m_reset_responder_fn;
     this->m_fota_invocation_fn = responder.m_fota_invocation_fn;
     this->m_fota_manifest = responder.m_fota_manifest;
-    this->m_state_resource = responder.m_state_resource;
-    this->m_result_resource = responder.m_result_resource;
+    this->m_firmware_composite_resource = responder.m_firmware_composite_resource;
 }
 
 // destructor
@@ -93,6 +91,8 @@
     this->m_fota_manifest = (char *)fota_manifest;
 }
 
+// get the FOTA manifest
+char *DeviceManagementResponder::getFOTAManifest() { return this->m_fota_manifest; }
 
 // ACTION: deregister device
 void DeviceManagementResponder::deregisterDevice(const void *challenge) {
@@ -125,15 +125,6 @@
         if (this->m_endpoint != NULL) {            
             // authenticate
             if (this->authenticate(challenge)) {
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(reboot): de-registering device...");
-
-                // act
-                ((Connector::Endpoint *)this->m_endpoint)->de_register_endpoint();
-                
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(reboot): rebooting device...");
-                
                 // act
                 (*this->m_reboot_responder_fn)((const void *)this->m_endpoint,(const void *)this->m_logger,NULL);
             }
@@ -161,15 +152,6 @@
         if (this->m_endpoint != NULL) {
             // authenticate
             if (this->authenticate(challenge)) {
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(reset): de-registering device...");
-
-                // act
-                ((Connector::Endpoint *)this->m_endpoint)->de_register_endpoint();
-                
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(reset): resetting device...");
-                
                 // act
                 (*this->m_reset_responder_fn)((const void *)this->m_endpoint,(const void *)this->m_logger,NULL);
             }
@@ -197,15 +179,6 @@
         if (this->m_endpoint != NULL) {            
             // authenticate
             if (this->authenticate(challenge)) {
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(FOTA): de-registering device...");
-
-                // act
-                ((Connector::Endpoint *)this->m_endpoint)->de_register_endpoint();
-                
-                // DEBUG
-                this->m_logger->log("DeviceManagementResponder(FOTA): invoking FOTA on device...");
-                
                 // act
                 (*this->m_fota_invocation_fn)((const void *)this->m_endpoint,(const void *)this->m_logger,this->m_fota_manifest);
                 
@@ -228,19 +201,10 @@
     }
 }
 
-// set the state resource
-void DeviceManagementResponder::setStateResource(const void *state_resource) {
-    this->m_state_resource = (void *)state_resource;
+// set the firmware composite resource
+void DeviceManagementResponder::setFirmwareCompositeResource(const void *firmware_composite_resource) {
+    this->m_firmware_composite_resource = (void *)firmware_composite_resource;
 }
 
-// get the state resource
-void *DeviceManagementResponder::getStateResource() { return this->m_state_resource; }
-
-// set the result resource
-void DeviceManagementResponder::setResultResource(const void *result_resource) {
-    this->m_result_resource = (void *)result_resource;
-}
-
-// get the result resource
-void *DeviceManagementResponder::getResultResource() { return this->m_result_resource; }
-
+// get the firmware composie resource
+void *DeviceManagementResponder::getFirmwareCompositeResource() { return this->m_firmware_composite_resource; }