Bluetooth: host: Document connection object behaviour
Add documentation for why connection objects are still in use during the disconnected callback and document error code when starting connectable advertiser with no free connection object available. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
4401b6a2f3
commit
c353fdfa0f
2 changed files with 17 additions and 4 deletions
|
@ -363,11 +363,14 @@ struct bt_le_adv_param {
|
|||
* @param sd_len Number of elements in sd
|
||||
*
|
||||
* @return Zero on success or (negative) error code otherwise.
|
||||
* @return -ENOMEM No free connection objects available for connectable
|
||||
* advertiser.
|
||||
* @return -ECONNREFUSED When connectable advertising is requested and there
|
||||
* is already maximum number of connections established.
|
||||
* This error code is only guaranteed when using Zephyr
|
||||
* controller, for other controllers code returned in
|
||||
* this case may be -EIO.
|
||||
* is already maximum number of connections established
|
||||
* in the controller.
|
||||
* This error code is only guaranteed when using Zephyr
|
||||
* controller, for other controllers code returned in
|
||||
* this case may be -EIO.
|
||||
*/
|
||||
int bt_le_adv_start(const struct bt_le_adv_param *param,
|
||||
const struct bt_data *ad, size_t ad_len,
|
||||
|
|
|
@ -304,6 +304,7 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer,
|
|||
* @param param Initial connection parameters.
|
||||
*
|
||||
* @return Zero on success or (negative) error code on failure.
|
||||
* @return -ENOMEM No free connection object available.
|
||||
*/
|
||||
int bt_conn_create_auto_le(const struct bt_le_conn_param *param);
|
||||
|
||||
|
@ -492,6 +493,15 @@ struct bt_conn_cb {
|
|||
* This callback notifies the application that a connection
|
||||
* has been disconnected.
|
||||
*
|
||||
* When this callback is called the stack still has one reference to
|
||||
* the connection object. If the application in this callback tries to
|
||||
* start either a connectable advertiser or create a new connection
|
||||
* this might fail because there are no free connection objects
|
||||
* available.
|
||||
* To avoid this issue it is recommended to either start connectable
|
||||
* advertise or create a new connection using @ref k_work_submit or
|
||||
* increase :option:`CONFIG_BT_MAX_CONN`.
|
||||
*
|
||||
* @param conn Connection object.
|
||||
* @param reason HCI reason for the disconnection.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue