Skip to content

Commit 02f71cb

Browse files
committed
Bluetooth: Host: Amend recycled() callback documentation
The API documentation for the recycled() callback predates [1], and still warns users to "treat this callback as an ISR", although it now runs on the system workqueue thread, as does disconnected(). "Making Bluetooth API calls" to "re-start connectable advertising or scanning" should no longer be "strongly discouraged". On the contrary, we can emphasize that this is the right event to listen for to initiate operations that will try to re-allocate a freed connection object. Mention that BT_MAX_CONN configures the size of the connection pool. Refs: - [1] efb5d83: Bluetooth: Host: Defer `conn.recycled()` to the syswq Signed-off-by: Christophe Dufaza <[email protected]>
1 parent a517113 commit 02f71cb

File tree

1 file changed

+6
-5
lines changed
  • include/zephyr/bluetooth

1 file changed

+6
-5
lines changed

include/zephyr/bluetooth/conn.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,12 +1891,13 @@ struct bt_conn_cb {
18911891
* This callback notifies the application that it might be able to
18921892
* allocate a connection object. No guarantee, first come, first serve.
18931893
*
1894-
* Use this to e.g. re-start connectable advertising or scanning.
1894+
* The maximum number of simultaneous connections is configured
1895+
* by @kconfig{CONFIG_BT_MAX_CONN}.
18951896
*
1896-
* Treat this callback as an ISR, as it originates from
1897-
* @ref bt_conn_unref which is used by the BT stack. Making
1898-
* Bluetooth API calls in this context is error-prone and strongly
1899-
* discouraged.
1897+
* This is the event to listen for to start a new connection or connectable advertiser,
1898+
* both when the intention is to start it after the system is completely
1899+
* finished with an earlier connection, and when the application wants to start
1900+
* a connection for any reason but failed and is waiting for the right time to retry.
19001901
*/
19011902
void (*recycled)(void);
19021903

0 commit comments

Comments
 (0)