Integrate OCStop API with CA
authorSakthivel Samidurai <sakthivel.samidurai@intel.com>
Mon, 12 Jan 2015 19:56:27 +0000 (16:56 -0300)
committerSakthivel Samidurai <sakthivel.samidurai@intel.com>
Mon, 12 Jan 2015 19:56:27 +0000 (16:56 -0300)
OCStop to call CATerminate for the CA intgeration

Change-Id: I2d408715256cce7fe6236348fd362a59dd5c60be
Signed-off-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
resource/csdk/stack/src/ocstack.c

index 7f31347..cd4ea07 100644 (file)
@@ -1348,9 +1348,15 @@ OCStackResult OCStop()
     // Free memory dynamically allocated for resources
     deleteAllResources();
     DeleteDeviceInfo();
+#ifdef CA_INT
+    CATerminate();
+    //CATerminate does not return any error code. It is OK to assign result to OC_STACK_OK.
+    result = OC_STACK_OK;
+#else //CA_INT
+    result = OCStopCoAP();
+#endif //CA_INT
 
-    // Make call to OCCoAP layer
-    if (OCStopCoAP() == OC_STACK_OK)
+    if (result == OC_STACK_OK)
     {
         // Remove all observers
         DeleteObserverList();