diff options
author | Marcin Kraglak <marcin.kraglak@tieto.com> | 2014-10-23 12:15:36 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-10-23 14:47:17 +0200 |
commit | 5e35bc7b06b5a3209a51ae83eca8e4b1d8523e6a (patch) | |
tree | a0d8bcd8cdc392b221526cca2b0bb84e72e43b28 /tools/btgatt-client.c | |
parent | 7f41af77a3920beb7a4ac7c2f2f1570d2ea5c16d (diff) | |
download | bluez-5e35bc7b06b5a3209a51ae83eca8e4b1d8523e6a.tar.gz |
tools/btgatt-client: Print found include services
Diffstat (limited to 'tools/btgatt-client.c')
-rw-r--r-- | tools/btgatt-client.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c index d21bc3422..b7bfa2462 100644 --- a/tools/btgatt-client.c +++ b/tools/btgatt-client.c @@ -174,7 +174,9 @@ static void print_uuid(const uint8_t uuid[16]) static void print_service(const bt_gatt_service_t *service) { struct bt_gatt_characteristic_iter iter; + struct bt_gatt_incl_service_iter include_iter; const bt_gatt_characteristic_t *chrc; + const bt_gatt_included_service_t *incl; size_t i; if (!bt_gatt_characteristic_iter_init(&iter, service)) { @@ -182,12 +184,25 @@ static void print_service(const bt_gatt_service_t *service) return; } + if (!bt_gatt_include_service_iter_init(&include_iter, service)) { + PRLOG("Failed to initialize include service iterator\n"); + return; + } + printf(COLOR_RED "service" COLOR_OFF " - start: 0x%04x, " "end: 0x%04x, type: %s, uuid: ", service->start_handle, service->end_handle, service->primary ? "primary" : "secondary"); print_uuid(service->uuid); + while (bt_gatt_include_service_iter_next(&include_iter, &incl)) { + printf("\t " COLOR_GREEN "include" COLOR_OFF " - handle: " + "0x%04x, - start: 0x%04x, end: 0x%04x," + "uuid: ", incl->handle, + incl->start_handle, incl->end_handle); + print_uuid(incl->uuid); + } + while (bt_gatt_characteristic_iter_next(&iter, &chrc)) { printf("\t " COLOR_YELLOW "charac" COLOR_OFF " - start: 0x%04x, end: 0x%04x, " |