Bluetooth: Shell: Convert users of hexdump to shell_hexdump

This replaces the use of hexdump with shell_hexdump and removes the
former.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2019-03-19 18:28:58 +02:00 committed by Anas Nashif
commit 09c06a1232
3 changed files with 2 additions and 31 deletions

View file

@ -336,34 +336,6 @@ static int cmd_init(const struct shell *shell, size_t argc, char *argv[])
return err;
}
#if defined(CONFIG_BT_HCI) || defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL)
void hexdump(const struct shell *shell, const u8_t *data, size_t len)
{
int n = 0;
while (len--) {
if (n % 16 == 0) {
shell_print(shell, "%08X ", n);
}
shell_print(shell, "%02X ", *data++);
n++;
if (n % 8 == 0) {
if (n % 16 == 0) {
shell_print(shell, "");
} else {
shell_print(shell, " ");
}
}
}
if (n % 16) {
shell_print(shell, "");
}
}
#endif /* CONFIG_BT_HCI || CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */
#if defined(CONFIG_BT_HCI)
static int cmd_hci_cmd(const struct shell *shell, size_t argc, char *argv[])
{
@ -390,7 +362,7 @@ static int cmd_hci_cmd(const struct shell *shell, size_t argc, char *argv[])
shell_error(shell, "HCI command failed (err %d)", err);
return err;
} else {
hexdump(shell, rsp->data, rsp->len);
shell_hexdump(shell, rsp->data, rsp->len);
net_buf_unref(rsp);
}

View file

@ -18,6 +18,5 @@ extern struct bt_conn *default_conn;
int str2bt_addr(const char *str, bt_addr_t *addr);
void conn_addr_str(struct bt_conn *conn, char *addr, size_t len);
void hexdump(const struct shell *shell, const u8_t *data, size_t len);
#endif /* __BT_H */

View file

@ -98,7 +98,7 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
buf->len);
if (buf->len) {
hexdump(ctx_shell, buf->data, buf->len);
shell_hexdump(ctx_shell, buf->data, buf->len);
}
if (l2cap_recv_delay) {