Unset gatt callback in network monitor 97/175097/1
authorVeeraj Khokale <veeraj.sk@samsung.com>
Tue, 3 Apr 2018 10:58:55 +0000 (16:28 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Sun, 8 Apr 2018 23:41:26 +0000 (08:41 +0900)
Gatt connection state changed callback is set in the
network monitor (calenwmonitor.c) but is unset in the
gatt client (caleclient.c). Move this to network
monitor instead

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/278
(cherry picked from commit 961ff08710e7acd99277a335f7d9eeca2f68c16e)

Change-Id: I9ee9da268d63fe0d379e4596c901552b10ceb0f1
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor.c

index a829960..b0f374c 100644 (file)
@@ -811,8 +811,6 @@ void CALEGattUnSetCallbacks()
 {
     OIC_LOG(DEBUG, TAG, "IN");
 
-    bt_gatt_unset_connection_state_changed_cb();
-
     int numOfServersConnected = CAGetRegisteredServiceCount();
     LEServerInfo *leServerInfo = NULL;
 
index 5775877..9f2a527 100644 (file)
@@ -202,8 +202,14 @@ CAResult_t CAStartLEAdapter()
 
 CAResult_t CAStopLEAdapter()
 {
+    int ret = bt_gatt_unset_connection_state_changed_cb();
+    if (BT_ERROR_NONE != ret)
+    {
+        OIC_LOG(DEBUG, TAG, "bt_gatt_unset_connection_state_changed_cb failed");
+        return CA_STATUS_FAILED;
+    }
 
-    int ret = bt_adapter_unset_state_changed_cb();
+    ret = bt_adapter_unset_state_changed_cb();
     if (BT_ERROR_NONE != ret)
     {
         OIC_LOG(DEBUG, TAG, "bt_adapter_unset_state_changed_cb failed");