Skip to contentSkip to conversation

shared/gatt-client: Fix removing services with no attributes

PATCH New Luiz Augusto von Dentz 1 participant 1 message May 30, 2017 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 shared/gatt-client: Fix removing services with no attributes

From: Luiz Augusto von Dentz <[email protected]>

If a service has no attributes, like IPSS, just mark it as active and skip doing any attribute discover.

---
 src/shared/gatt-client.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
src/shared/gatt-client.c +5 -1
index b8f70c8..58ab0b8 100644
@@ -890,7 +890,11 @@ static void discovery_found_service(struct discovery_op *op,
 {
 	/* Skip if service already active */
 	if (!gatt_db_service_get_active(attr)) {
-		queue_push_tail(op->pending_svcs, attr);
+		/* Skip if there are no attributes */
+		if (end == start)
+			gatt_db_service_set_active(attr, true);
+		else
+			queue_push_tail(op->pending_svcs, attr);
 
 		/* Update discovery range */
 		if (!op->svc_first || op->svc_first > start)
Signature · 1 line
2.9.4