From 38a59587401ee22dbadf874ff484b14fb4811fb6 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 27 Oct 2011 17:06:26 +0200 Subject: [PATCH] Add more verbose logs to index list response in btmgmt --- mgmt/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mgmt/main.c b/mgmt/main.c index 7a572f49d..884c8c006 100644 --- a/mgmt/main.c +++ b/mgmt/main.c @@ -480,17 +480,30 @@ static void index_rsp(int mgmt_sk, uint16_t op, uint16_t id, uint8_t status, exit(EXIT_FAILURE); } + if (monitor) + printf("Index list with %u item%s\n", + count, count > 1 ? "s" : ""); + + if (monitor && count > 0) + printf("\t"); + for (i = 0; i < count; i++) { uint16_t index; index = bt_get_le16(&rp->index[i]); + if (monitor) + printf("hci%u ", index); + if (mgmt_send_cmd(mgmt_sk, MGMT_OP_READ_INFO, index, NULL, 0, info_rsp, NULL) < 0) { fprintf(stderr, "Unable to send read_info cmd\n"); exit(EXIT_FAILURE); } } + + if (monitor && count > 0) + printf("\n"); } static void cmd_info(int mgmt_sk, int argc, char **argv) -- 2.47.3