Skip to content

Commit

Permalink
Bluetooth: shell: Add sent callback to L2CAP ops
Browse files Browse the repository at this point in the history
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 29, 2019
1 parent d8f20fe commit 74135b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions subsys/bluetooth/shell/l2cap.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
return 0; 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) static void l2cap_connected(struct bt_l2cap_chan *chan)
{ {
struct l2ch *c = L2CH_CHAN(chan); struct l2ch *c = L2CH_CHAN(chan);
Expand Down Expand Up @@ -143,6 +148,7 @@ static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan)
static struct bt_l2cap_chan_ops l2cap_ops = { 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,
.connected = l2cap_connected, .connected = l2cap_connected,
.disconnected = l2cap_disconnected, .disconnected = l2cap_disconnected,
}; };
Expand Down

0 comments on commit 74135b3

Please sign in to comment.