Skip to content
Permalink
Browse files

Bluetooth: shell: Add sent callback to L2CAP ops

This prints to the output when a packet finishes transmitting:

uart:~$ l2cap send 2
Outgoing data channel 0x005166a0 transmitted
Outgoing data channel 0x005166a0 transmitted

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information...
Vudentz authored and jhedberg committed May 21, 2019
1 parent d8f20fe commit 74135b3392b81ab7d4d8fe2bbf035537e9de3ea7
Showing with 6 additions and 0 deletions.
  1. +6 −0 subsys/bluetooth/shell/l2cap.c
@@ -116,6 +116,11 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
return 0;
}

static void l2cap_sent(struct bt_l2cap_chan *chan)
{
shell_print(ctx_shell, "Outgoing data channel %p transmitted", chan);
}

static void l2cap_connected(struct bt_l2cap_chan *chan)
{
struct l2ch *c = L2CH_CHAN(chan);
@@ -143,6 +148,7 @@ static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan)
static struct bt_l2cap_chan_ops l2cap_ops = {
.alloc_buf = l2cap_alloc_buf,
.recv = l2cap_recv,
.sent = l2cap_sent,
.connected = l2cap_connected,
.disconnected = l2cap_disconnected,
};

0 comments on commit 74135b3

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