From d6c07ecf22ba60d6dd1b7302281eb32e1f278ca7 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 30 May 2017 14:40:56 +0300 Subject: [PATCH] shared/gatt-client: Fix removing services with no attributes 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(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index b8f70c8db..58ab0b858 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -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) -- 2.47.3