Skip to content
Permalink
Browse files

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>
  • Loading branch information...
Vudentz authored and nashif committed Mar 19, 2019
1 parent 65e350e commit 09c06a123261f4f123d4f59009ff10d99705972d
Showing with 2 additions and 31 deletions.
  1. +1 −29 subsys/bluetooth/shell/bt.c
  2. +0 −1 subsys/bluetooth/shell/bt.h
  3. +1 −1 subsys/bluetooth/shell/l2cap.c
@@ -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);
}

@@ -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 */
@@ -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) {

0 comments on commit 09c06a1

Please sign in to comment.
You can’t perform that action at this time.