mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 18:40:27 +00:00
sm: fix accidental SM_EVENT_PAIRING_COMPLETE on HCI Disconnect
This commit is contained in:
parent
dc3878e895
commit
03f736b157
@ -3335,7 +3335,10 @@ static void sm_event_packet_handler (uint8_t packet_type, uint16_t channel, uint
|
||||
le_device_db_remove(sm_conn->sm_le_db_index);
|
||||
}
|
||||
|
||||
sm_notify_client_status_reason(sm_conn, ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION, 0);
|
||||
// pairing failed, if it was ongoing
|
||||
if (sm_conn->sm_engine_state != SM_INITIATOR_CONNECTED && sm_conn->sm_engine_state != SM_GENERAL_IDLE){
|
||||
sm_notify_client_status_reason(sm_conn, ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION, 0);
|
||||
}
|
||||
|
||||
sm_conn->sm_engine_state = SM_GENERAL_IDLE;
|
||||
sm_conn->sm_handle = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user