Fixed gatt notification changed callback 52/198452/1
authorAmit Purwar <amit.purwar@samsung.com>
Thu, 24 Jan 2019 13:24:43 +0000 (18:54 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Thu, 24 Jan 2019 13:24:43 +0000 (18:54 +0530)
Change-Id: I8e9041c56bbfe740c2502a2c3d9c216d7ddf31ca
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/bluetooth-common.c

index 6f62ed5..57faf14 100644 (file)
@@ -900,8 +900,8 @@ static bt_gatt_server_characteristic_notification_state_changed_cb
                                bt_gatt_characteristic_s *chr = l3->data;
 
                                if (chr && chr->handle == handle) {
-                                       if (chr->notified_cb) {
-                                               *user_data = chr->notified_user_data;
+                                       if (chr->notification_changed_cb) {
+                                               *user_data = chr->notification_changed_user_data;
                                                *char_handle =  (bt_gatt_h*) chr;
                                                *server = serv;
                                                return chr->notification_changed_cb;
@@ -2587,8 +2587,10 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                cb = __bt_gatt_attribute_get_notification_change_cb(&server_handle,
                                                notif_info->handle, &char_handle, &user_data_cfm);
 
-               if (cb == NULL)
+               if (cb == NULL) {
+                       BT_INFO("cb is NULL");
                        return;
+               }
 
                cb(notif_info->notification, server_handle, char_handle, user_data_cfm);
 #else