Skip to content

Commit 09c06a1

Browse files
Vudentznashif
authored andcommitted
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 <[email protected]>
1 parent 65e350e commit 09c06a1

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -336,34 +336,6 @@ static int cmd_init(const struct shell *shell, size_t argc, char *argv[])
336336
return err;
337337
}
338338

339-
#if defined(CONFIG_BT_HCI) || defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL)
340-
void hexdump(const struct shell *shell, const u8_t *data, size_t len)
341-
{
342-
int n = 0;
343-
344-
while (len--) {
345-
if (n % 16 == 0) {
346-
shell_print(shell, "%08X ", n);
347-
}
348-
349-
shell_print(shell, "%02X ", *data++);
350-
351-
n++;
352-
if (n % 8 == 0) {
353-
if (n % 16 == 0) {
354-
shell_print(shell, "");
355-
} else {
356-
shell_print(shell, " ");
357-
}
358-
}
359-
}
360-
361-
if (n % 16) {
362-
shell_print(shell, "");
363-
}
364-
}
365-
#endif /* CONFIG_BT_HCI || CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */
366-
367339
#if defined(CONFIG_BT_HCI)
368340
static int cmd_hci_cmd(const struct shell *shell, size_t argc, char *argv[])
369341
{
@@ -390,7 +362,7 @@ static int cmd_hci_cmd(const struct shell *shell, size_t argc, char *argv[])
390362
shell_error(shell, "HCI command failed (err %d)", err);
391363
return err;
392364
} else {
393-
hexdump(shell, rsp->data, rsp->len);
365+
shell_hexdump(shell, rsp->data, rsp->len);
394366
net_buf_unref(rsp);
395367
}
396368

subsys/bluetooth/shell/bt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ extern struct bt_conn *default_conn;
1818

1919
int str2bt_addr(const char *str, bt_addr_t *addr);
2020
void conn_addr_str(struct bt_conn *conn, char *addr, size_t len);
21-
void hexdump(const struct shell *shell, const u8_t *data, size_t len);
2221

2322
#endif /* __BT_H */

subsys/bluetooth/shell/l2cap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
9898
buf->len);
9999

100100
if (buf->len) {
101-
hexdump(ctx_shell, buf->data, buf->len);
101+
shell_hexdump(ctx_shell, buf->data, buf->len);
102102
}
103103

104104
if (l2cap_recv_delay) {

0 commit comments

Comments
 (0)