summaryrefslogtreecommitdiff
path: root/tools/btgatt-client.c
diff options
context:
space:
mode:
authorArman Uguray <armansito@chromium.org>2014-12-08 16:40:46 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-12-09 14:49:08 +0200
commit20dd67fd18a2e2bebbc7e5e4a76ff41133741e96 (patch)
tree22afe261eceef84638767d0ddf81b1bd9955d3f8 /tools/btgatt-client.c
parent454650bdadae60573c4d52249814eed4dfab21b4 (diff)
downloadbluez-20dd67fd18a2e2bebbc7e5e4a76ff41133741e96.tar.gz
shared/gatt-db: Add UUID arg to foreach_service
This patch adds the "uuid" argument to gatt_db_foreach_service, which invokes the callback for a service only if "uuid" is NULL or if it matches the GATT service UUID.
Diffstat (limited to 'tools/btgatt-client.c')
-rw-r--r--tools/btgatt-client.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c
index fe94ae8bb..015142d36 100644
--- a/tools/btgatt-client.c
+++ b/tools/btgatt-client.c
@@ -288,15 +288,14 @@ static void print_services(struct client *cli)
{
printf("\n");
- gatt_db_foreach_service(cli->db, print_service, cli);
+ gatt_db_foreach_service(cli->db, NULL, print_service, cli);
}
static void print_services_by_uuid(struct client *cli, const bt_uuid_t *uuid)
{
printf("\n");
- /* TODO: Filter by UUID */
- gatt_db_foreach_service(cli->db, print_service, cli);
+ gatt_db_foreach_service(cli->db, uuid, print_service, cli);
}
static void print_services_by_handle(struct client *cli, uint16_t handle)
@@ -304,7 +303,7 @@ static void print_services_by_handle(struct client *cli, uint16_t handle)
printf("\n");
/* TODO: Filter by handle */
- gatt_db_foreach_service(cli->db, print_service, cli);
+ gatt_db_foreach_service(cli->db, NULL, print_service, cli);
}
static void ready_cb(bool success, uint8_t att_ecode, void *user_data)
@@ -331,7 +330,7 @@ static void service_changed_cb(uint16_t start_handle, uint16_t end_handle,
printf("\nService Changed handled - start: 0x%04x end: 0x%04x\n",
start_handle, end_handle);
- gatt_db_foreach_service_in_range(cli->db, print_service, cli,
+ gatt_db_foreach_service_in_range(cli->db, NULL, print_service, cli,
start_handle, end_handle);
print_prompt();
}