From 20878102b6c6fbb13363263549f7a1efda464a91 Mon Sep 17 00:00:00 2001 From: Sakthivel Samidurai Date: Mon, 12 Jan 2015 16:56:27 -0300 Subject: [PATCH] Integrate OCStop API with CA OCStop to call CATerminate for the CA intgeration Change-Id: I2d408715256cce7fe6236348fd362a59dd5c60be Signed-off-by: Sakthivel Samidurai --- resource/csdk/stack/src/ocstack.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index 7f31347..cd4ea07 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -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(); -- 2.7.4