Skip to content
Permalink
Browse files

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 <luiz.von.dentz@intel.com>
  • Loading branch information...
Vudentz authored and jhedberg committed May 22, 2019
1 parent c904a45 commit f8f6e7e1172cfbaaed3af55bb9c94ec4a067e861
Showing with 6 additions and 0 deletions.
  1. +6 −0 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,
};

0 comments on commit f8f6e7e

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