shared/gatt-client: Fix attempting to discovery with handle 0 40/204940/1
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 14 Mar 2018 12:51:29 +0000 (14:51 +0200)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 26 Apr 2019 10:51:24 +0000 (16:21 +0530)
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 <amit.purwar@samsung.com>
src/shared/gatt-client.c

index b8d5757..a681f26 100644 (file)
@@ -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