Diff between 3eeab57293f2810a69623630ad78146460fc2753 and 67a4bda1cf976539802bbb9e747ba0be7b9300a9

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +9 -0 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 724fc53..7e9d550 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -1009,6 +1009,15 @@ static void discover_primary_cb(bool success, uint8_t att_ecode,
 	}
 
 secondary:
+	/*
+	 * Version 4.2 [Vol 1, Part A] page 101:
+	 * A secondary service is a service that provides auxiliary
+	 * functionality of a device and is referenced from at least one
+	 * primary service on the device.
+	 */
+	if (queue_isempty(op->pending_svcs))
+		goto done;
+
 	/* Discover secondary services */
 	client->discovery_req = bt_gatt_discover_secondary_services(client->att,
 						NULL, op->start, op->end,