Skip to content
Commit 46b78bb1 authored by Pavel Vasilyev's avatar Pavel Vasilyev Committed by Carles Cufi
Browse files

Bluetooth: Mesh: Stop scanner before resetting mesh



When we receive Node Reset message, we schedule work in the system
workqueue to call bt_mesh_reset(). In bt_mesh_reset() we call
bt_conn_disconnect() to disconnect proxy client. bt_conn_disconnect()
will put a buffer to a pool and call k_sem_take to let BT HCI TX thread
process this buffer. Because we stop scanner after disconnecting the
proxy, we can still receive a message at this point. Since BT RX thread
has higher priority than the system workqueue, if we receive a message
while in bt_mesh_reset(), it will be processed when we call
bt_conn_disconnect().

Stop scanner before resetting the mesh to avoid processing of a received
mesh message while in the process of resetting mesh.

Signed-off-by: default avatarPavel Vasilyev <pavel.vasilyev@nordicsemi.no>
parent 6dfc9ecc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment