Skip to content

Commit b026360

Browse files
Vudentznashif
authored andcommitted
Bluetooth: ATT: Add documentation for chan_send
chan_send does restore buffer state in case of an error which is different than how bt_l2cap_send_cb works as it does always unref in case of an error. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 66f77f9 commit b026360

File tree

1 file changed

+7
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+7
-0
lines changed

subsys/bluetooth/host/att.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ void att_sent(struct bt_conn *conn, void *user_data)
130130
}
131131
}
132132

133+
/* In case of success the ownership of the buffer is transferred to the stack
134+
* which takes care of releasing it when it completes transmitting to the
135+
* controller.
136+
*
137+
* In case bt_l2cap_send_cb fails the buffer state and ownership are retained
138+
* so the buffer can be safely pushed back to the queue to be processed later.
139+
*/
133140
static int chan_send(struct bt_att_chan *chan, struct net_buf *buf,
134141
bt_att_chan_sent_t cb)
135142
{

0 commit comments

Comments
 (0)