[PATCH BlueZ 9/9] btgatt-client: Implement filter service by start handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tools/btgatt-client.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c
index b7a23ac9b..629063d5c 100644
--- a/tools/btgatt-client.c
+++ b/tools/btgatt-client.c
@@ -377,8 +377,13 @@ static void print_services_by_uuid(const bt_uuid_t *uuid)
 
 static void print_services_by_handle(uint16_t handle)
 {
-	/* TODO: Filter by handle */
-	gatt_db_foreach_service(cli->db, NULL, print_service, cli);
+	uint16_t start = 0x0001, end = 0xFFFF;
+	if (handle) {
+		start = handle;
+		end = handle;
+	}
+	gatt_db_foreach_service_in_range(cli->db, NULL, print_service, NULL,
+			start, end);
 }
 
 static void ready_cb(bool success, uint8_t att_ecode, void *user_data)
-- 
2.34.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux