diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-08-28 10:53:55 -0700 |
---|---|---|
committer | Ayush Garg <ayush.garg@samsung.com> | 2024-01-05 19:04:03 +0530 |
commit | 298393c55d1061a2509247e52da41b152f1c06e7 (patch) | |
tree | 2826148c2cf9356f8a182dc3aabb0e35ae6d2e88 | |
parent | 6a9cdd446d3e835868fbf50c07ffcafd4f42d214 (diff) | |
download | bluez-298393c55d1061a2509247e52da41b152f1c06e7.tar.gz bluez-298393c55d1061a2509247e52da41b152f1c06e7.tar.bz2 bluez-298393c55d1061a2509247e52da41b152f1c06e7.zip |
shared/gatt-client: Fix not sending confirmations
Commit fde32ff9c9c0 ("shared/gatt-client: Allow registering with NULL
callback") added an early return to the notify_cb function when the
current client's notify_list is empty which prevents sending
confirmations to indications.
Reported-by: Javier de San Pedro <dev.git@javispedro.com>
-rw-r--r-- | src/shared/gatt-client.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index 73f762b1..309f4dc5 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -2547,11 +2547,11 @@ static void notify_cb(struct bt_att_chan *chan, uint8_t opcode, } #endif - if (queue_isempty(client->notify_list)) - return; - bt_gatt_client_ref(client); + if (queue_isempty(client->notify_list)) + goto done; + memset(&data, 0, sizeof(data)); if (opcode == BT_ATT_OP_HANDLE_NFY_MULT) { @@ -2585,6 +2585,7 @@ static void notify_cb(struct bt_att_chan *chan, uint8_t opcode, queue_foreach(client->notify_list, notify_handler, &data); } +done: if (opcode == BT_ATT_OP_HANDLE_IND && !client->parent){ #ifdef TIZEN_FEATURE_BLUEZ_MODIFY if (!chan) |