Skip to content

Commit

Permalink
Bluetooth: L2CAP: Mention recv() callback is mandatory
Browse files Browse the repository at this point in the history
It is already checked against `NULL` in the codepaths that take the
`ops` struct as a parameter.

Add a note in the documentation to make the requirement official.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
  • Loading branch information
jori-nordic authored and nashif committed Aug 19, 2024
1 parent 6a3602a commit 454aadc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/zephyr/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ struct bt_l2cap_br_chan {
struct k_fifo _pdu_tx_queue;
};

/** @brief L2CAP Channel operations structure. */
/** @brief L2CAP Channel operations structure.
*
* The object has to stay valid and constant for the lifetime of the channel.
*/
struct bt_l2cap_chan_ops {
/** @brief Channel connected callback
*
Expand Down Expand Up @@ -342,6 +345,10 @@ struct bt_l2cap_chan_ops {
* @param chan The channel receiving data.
* @param buf Buffer containing incoming data.
*
* @note This callback is mandatory, unless
* @kconfig{CONFIG_BT_L2CAP_SEG_RECV} is enabled and seg_recv is
* supplied.
*
* @return 0 in case of success or negative value in case of error.
* @return -EINPROGRESS in case where user has to confirm once the data
* has been processed by calling
Expand Down

0 comments on commit 454aadc

Please sign in to comment.