diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-12-20 02:38:22 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-20 02:38:22 +0100 |
commit | 1ed206f31e4cf41b805a81da46a88cc0ceba22a1 (patch) | |
tree | 205600c3297a9026c4b75a7a266b42c58ec37592 /monitor | |
parent | 9545b68180ded6924830ece5af483ab2cca55cea (diff) |
monitor: Print legacy PIN code in ASCII and not hex
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/packet.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/monitor/packet.c b/monitor/packet.c index fb2d8d7c8..42ffe8993 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -777,9 +777,15 @@ static void print_link_key(const uint8_t *link_key) print_key("Link key", link_key); } -static void print_pin_code(const uint8_t *pin_code) +static void print_pin_code(const uint8_t *pin_code, uint8_t pin_len) { - print_key("PIN code", pin_code); + char str[pin_len + 1]; + uint8_t i; + + for (i = 0; i < pin_len; i++) + sprintf(str + i, "%c", (const char) pin_code[i]); + + print_field("PIN code: %s", str); } static void print_hash(const uint8_t *hash) @@ -1994,7 +2000,7 @@ static void pin_code_request_reply_cmd(const void *data, uint8_t size) print_bdaddr(cmd->bdaddr); print_field("PIN length: %d", cmd->pin_len); - print_pin_code(cmd->pin_code); + print_pin_code(cmd->pin_code, cmd->pin_len); } static void pin_code_request_neg_reply_cmd(const void *data, uint8_t size) |