From: Luiz Augusto von Dentz Date: Fri, 17 Jul 2020 19:08:14 +0000 (-0700) Subject: shared/gatt-client: Fix handling of service changed X-Git-Tag: submit/tizen/20210606.232858~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07850e3fe798a8a1c872aa85380131cc7bc03f4c;p=platform%2Fupstream%2Fbluez.git shared/gatt-client: Fix handling of service changed When handling multiple service changed multiple discovery operations would be performed but at the end of each one the hash would be read which not only would create extra traffic but also prevents the code to properly detection services disappering. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index aaab9e3a..5843ff2c 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -1603,8 +1603,10 @@ static bool read_db_hash(struct discovery_op *op) struct bt_gatt_client *client = op->client; bt_uuid_t uuid; - /* Check if hash was already read */ - if (op->hash) + /* Check if hash was already been read or there are more services to + * process. + */ + if (op->hash || !queue_isempty(client->svc_chngd_queue)) return false; bt_uuid16_create(&uuid, GATT_CHARAC_DB_HASH);