Diff between feade20353f3d8c24415e425f18df4a86e42f671 and d6c07ecf22ba60d6dd1b7302281eb32e1f278ca7

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +5 -1 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index b8f70c8..58ab0b8 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)