Skip to content

Commit e85c7de

Browse files
committed
Bluetooth: Host: Amend disconnected() callback documentation
The API documentation for the disconnected() callback warns that the connection object is not actually reusable at this stage, but some of the advice given may be misleading: - "start connectable advertising": the options that "will attempt to resume the advertiser under some conditions" are deprecated (BT_LE_ADV_OPT_CONNECTABLE and related), and the responsibility for this behavior has moved to the application [1] - "increase CONFIG_BT_MAX_CONN": does not really avoid the issue, only delays the point where there may be no free connection object when the disconnected() callback executes Also, the documentation predates [2] and [3], and does not mention the recycled() callback, which is now the most reliable API to track free connections and/or initiate operations that depend on them. [1] 8cfad44: Bluetooth: Deprecate adv auto-resume [2] efb5d83: Bluetooth: Host: Added Recycled evt notifying conn object is available [3] 2ca59e7: Bluetooth: Host: Defer `conn.recycled()` to the syswq Signed-off-by: Christophe Dufaza <[email protected]>
1 parent a2785e0 commit e85c7de

File tree

1 file changed

+3
-3
lines changed
  • include/zephyr/bluetooth

1 file changed

+3
-3
lines changed

include/zephyr/bluetooth/conn.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,9 +1690,9 @@ struct bt_conn_cb {
16901690
* start either a connectable advertiser or create a new connection
16911691
* this might fail because there are no free connection objects
16921692
* available.
1693-
* To avoid this issue it is recommended to either start connectable
1694-
* advertise or create a new connection using @ref k_work_submit or
1695-
* increase @kconfig{CONFIG_BT_MAX_CONN}.
1693+
* To avoid this issue it is recommended to either use @ref k_work_submit
1694+
* or rely on @ref bt_conn_cb.recycled to create new connections
1695+
* or resume connectable advertising.
16961696
*
16971697
* @param conn Connection object.
16981698
* @param reason BT_HCI_ERR_* reason for the disconnection.

0 commit comments

Comments
 (0)