From f79ca7b823162c2834903cab84b965176339f658 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 18 Feb 2014 13:54:28 +0200 Subject: [PATCH] tools/btmgmt: Print more detailed address information for pairing --- tools/btmgmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index f49f571c4..cd91916c7 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -1312,7 +1312,7 @@ static void pair_rsp(uint8_t status, uint16_t len, const void *param, goto done; } - printf("Paired with %s\n", addr); + printf("Paired with %s (%s)\n", addr, typestr(rp->addr.type)); done: mainloop_quit(); @@ -1335,6 +1335,7 @@ static void cmd_pair(struct mgmt *mgmt, uint16_t index, int argc, char **argv) struct mgmt_cp_pair_device cp; uint8_t cap = 0x01; uint8_t type = BDADDR_BREDR; + char addr[18]; int opt; while ((opt = getopt_long(argc, argv, "+c:t:h", pair_options, @@ -1370,6 +1371,9 @@ static void cmd_pair(struct mgmt *mgmt, uint16_t index, int argc, char **argv) cp.addr.type = type; cp.io_cap = cap; + ba2str(&cp.addr.bdaddr, addr); + printf("Pairing with %s (%s)\n", addr, typestr(cp.addr.type)); + if (mgmt_send(mgmt, MGMT_OP_PAIR_DEVICE, index, sizeof(cp), &cp, pair_rsp, NULL, NULL) == 0) { fprintf(stderr, "Unable to send pair_device cmd\n"); -- 2.47.3