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>
This commit is contained in:
Luiz Augusto von Dentz 2019-05-22 23:34:31 +03:00 committed by Johan Hedberg
commit f8f6e7e117

View file

@ -121,6 +121,11 @@ static void l2cap_sent(struct bt_l2cap_chan *chan)
shell_print(ctx_shell, "Outgoing data channel %p transmitted", 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) static void l2cap_connected(struct bt_l2cap_chan *chan)
{ {
struct l2ch *c = L2CH_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, .alloc_buf = l2cap_alloc_buf,
.recv = l2cap_recv, .recv = l2cap_recv,
.sent = l2cap_sent, .sent = l2cap_sent,
.status = l2cap_status,
.connected = l2cap_connected, .connected = l2cap_connected,
.disconnected = l2cap_disconnected, .disconnected = l2cap_disconnected,
}; };