From a53681d7c1e80d55cb9d9227237c29f11bcc4a3e Mon Sep 17 00:00:00 2001 From: Amit Purwar Date: Thu, 24 Jan 2019 18:54:43 +0530 Subject: [PATCH] Fixed gatt notification changed callback Change-Id: I8e9041c56bbfe740c2502a2c3d9c216d7ddf31ca Signed-off-by: Amit Purwar --- src/bluetooth-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 6f62ed5..57faf14 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -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 -- 2.34.1