Skip to content
Commit 4401b6a2 authored by Joakim Andersson's avatar Joakim Andersson Committed by Johan Hedberg
Browse files

Bluetooth: host: Stop using existing conn object when creating new conn



Remove re-using connection objects in disconnected state when creating
directed advertiser or establishing a connection as a central using
direct connection procedure.
This makes the API mores consistent it terms of which connection roles
can be started from the disconnected callback.
This also avoids a central connection object being re-used for a
connection as a peripheral instead and vice versa.

When attempting to create a new connection the API would returning
a valid connection object if there is already an existing connection
object.
This existing connection object could be either in the process of
establishing the connection or already connected.
Returning the connection object in this would give the false impression
that the stack has initiated connection procedure, when in fact it just
returned an existing connection object.

The application has the ability to check for existing connection objects
using the bt_conn_lookup_addr_le API.

Add warning plus comment possible scenarios why the a valid connection
object might exists. Most important is to explain why a valid connection
object exists during the disconnected callback.

Signed-off-by: default avatarJoakim Andersson <joakim.andersson@nordicsemi.no>
parent 46bf2003
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment