summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-03-14 14:51:29 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-03-15 10:38:21 +0200
commit969dfae9a7373dc22754e95d977993fe8564aca4 (patch)
treedc9f3a695fd5681dfbf99b172ac7ed77d3f45d65
parentfad3abf46ddc5b947f7b4fdff03ca9da685741b3 (diff)
downloadbluez-969dfae9a7373dc22754e95d977993fe8564aca4.tar.gz
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)
-rw-r--r--src/shared/gatt-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index c369ccb40..e1d489d32 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -988,7 +988,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;
client->discovery_req = bt_gatt_discover_included_services(client->att,