Skip to content
Commit e79fee7a authored by Sean Madigan's avatar Sean Madigan Committed by Carles Cufí
Browse files

bluetooth: host: conn: Utilize conn_set_state in conn_destroy



Previously we would call conn_cleanup for all connections,
however this had multiple problems such as:
-Not destroying conn->tx_pending packets and causing an assert
-Calling conn_cleanup for connectable adv, triggering
disconnected callback

Now we will use bt_conn_set_state to manage the teardown of
connections correctly. First, if in connected or disconnecting,
set state to disconnect complete. Then for all states, set
state to disconnected. This will carry out proper cleanup
and teardown when required.

To do this, it was required to keep the tx_thread open as
this is used in disconnecting teardown, so this has been
moved to below the conn_cleanup_all call.

Signed-off-by: default avatarSean Madigan <sean.madigan@nordicsemi.no>
parent 6ae75b6d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment