From 21b2c1eb891ca875195640d660dc0a7bb3779d6e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 14 Mar 2018 14:51:29 +0200 Subject: [PATCH] shared/gatt-client: Fix attempting to discovery with handle 0 If a service was removed an no other service was added it may happen that pending_svc has not empty but first_svc and last_svc has not been set causing the following request: < ACL Data TX: Handle 76 flags 0x00 dlen 11 ATT: Read By Type Request (0x08) len 6 Handle range: 0x0000-0x0000 Attribute type: Include (0x2802) Change-Id: Id628ff103fee0abfcb961aaa4e0032737b0c805c Signed-off-by: Amit Purwar --- src/shared/gatt-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index b8d5757..a681f26 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -1114,7 +1114,7 @@ static void discover_secondary_cb(bool success, uint8_t att_ecode, } next: - if (queue_isempty(op->pending_svcs)) + if (queue_isempty(op->pending_svcs) || !op->svc_first) goto done; #ifdef TIZEN_FEATURE_BLUEZ_MODIFY -- 2.7.4