mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-06 07:00:59 +00:00
sm: avoid SM_EVENT_PAIRING_COMPLETE with ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION after successful pairing in responder role
This commit is contained in:
parent
3311c2d57c
commit
7f3f442d49
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Fixed
|
||||
- Crypto: fix lockup when stack is shutdown while waiting for result of HCI Command, e.g. LE Read Local P256 Public Key
|
||||
- SM: Avoid SM_EVENT_PAIRING_COMPLETE with ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION after successful pairing in responder role
|
||||
|
||||
## Changes January 2019
|
||||
|
||||
|
10
src/ble/sm.c
10
src/ble/sm.c
@ -3213,8 +3213,14 @@ static void sm_event_packet_handler (uint8_t packet_type, uint16_t channel, uint
|
||||
}
|
||||
|
||||
// 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);
|
||||
switch (sm_conn->sm_engine_state){
|
||||
case SM_GENERAL_IDLE:
|
||||
case SM_INITIATOR_CONNECTED:
|
||||
case SM_RESPONDER_IDLE:
|
||||
break;
|
||||
default:
|
||||
sm_notify_client_status_reason(sm_conn, ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
sm_conn->sm_engine_state = SM_GENERAL_IDLE;
|
||||
|
Loading…
Reference in New Issue
Block a user