From 87a2e136bf9a61424569b9472720b2e8dc22dff2 Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Wed, 15 Feb 2017 19:21:37 +0900 Subject: [PATCH] fix timing issue for mutex access in ble Change-Id: I95917e8788bf3abce8c8cc143c5cf645286a5d5e Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/17733 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c | 4 ++-- resource/csdk/stack/src/ocstack.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 596209d..7feee61 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -2826,8 +2826,6 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback, } CAInitializeLEAdapter(); - CASetLEClientThreadPoolHandle(handle); - result = CAInitializeLEGattClient(); if (CA_STATUS_OK != result) { @@ -2835,6 +2833,8 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback, return CA_STATUS_FAILED; } + CASetLEClientThreadPoolHandle(handle); + CASetLEReqRespClientCallback(CALEAdapterClientReceivedData); CASetLEServerThreadPoolHandle(handle); result = CAInitializeLEGattServer(); diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index fe0ca73..9a55134 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -3590,6 +3590,7 @@ OCStackResult OCProcess() { if (stackState == OC_STACK_UNINITIALIZED) { + OIC_LOG(ERROR, TAG, "OCProcess has failed. ocstack is not initialized"); return OC_STACK_ERROR; } #ifdef WITH_PRESENCE -- 2.7.4