From f8f6e7e1172cfbaaed3af55bb9c94ec4a067e861 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 22 May 2019 23:34:31 +0300 Subject: [PATCH] Bluetooth: shell: Print L2CAP channel status This uses the new status callback to print the channel status whenever it changes. Signed-off-by: Luiz Augusto von Dentz --- subsys/bluetooth/shell/l2cap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subsys/bluetooth/shell/l2cap.c b/subsys/bluetooth/shell/l2cap.c index 7a0aea8e980..53a130dc981 100644 --- a/subsys/bluetooth/shell/l2cap.c +++ b/subsys/bluetooth/shell/l2cap.c @@ -121,6 +121,11 @@ static void l2cap_sent(struct bt_l2cap_chan *chan) shell_print(ctx_shell, "Outgoing data channel %p transmitted", chan); } +static void l2cap_status(struct bt_l2cap_chan *chan, atomic_t *status) +{ + shell_print(ctx_shell, "Channel %p status %u", chan, status); +} + static void l2cap_connected(struct bt_l2cap_chan *chan) { struct l2ch *c = L2CH_CHAN(chan); @@ -149,6 +154,7 @@ static struct bt_l2cap_chan_ops l2cap_ops = { .alloc_buf = l2cap_alloc_buf, .recv = l2cap_recv, .sent = l2cap_sent, + .status = l2cap_status, .connected = l2cap_connected, .disconnected = l2cap_disconnected, };