Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Document bt_conn_unref in public API and fix missing unref in samples #23066

Merged

Conversation

joerchan
Copy link
Contributor

Document the need for the caller to call bt_conn_unref on the
connection object returned from API functions.

Based on feedback here: #23050 (comment)

Fix missing unref in connected callback in the central samples. This error happens when initiator is canceled by the host through a timeout.

Document the need for the caller to call  bt_conn_unref on the
connection object returned from API functions.

Signed-off-by: Joakim Andersson <[email protected]>
Move the connected callback down together with the disconnected
callback.

Signed-off-by: Joakim Andersson <[email protected]>
Handle connected callback with error status not releasing the default
conn object in central samples. This can happen when the initiator fails
to create the connection within 3 seconds and is canceled by the host.

Also restart the scan role in this case.

Signed-off-by: Joakim Andersson <[email protected]>
@jhedberg jhedberg added this to the v2.2.0 milestone Feb 25, 2020
@jhedberg jhedberg merged commit 09b89ef into zephyrproject-rtos:master Feb 25, 2020
@joerchan joerchan deleted the bt-document-bt-conn-unref branch February 25, 2020 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants