sm: keep track of security request before sm received connection complete

This commit is contained in:
Matthias Ringwald 2016-05-13 16:53:44 +02:00
parent 7cef8eada7
commit e88b296181

View File

@ -3011,8 +3011,8 @@ void sm_request_pairing(hci_con_handle_t con_handle){
sm_send_security_request_for_connection(sm_conn);
} else {
// used as a trigger to start central/master/initiator security procedures
uint16_t ediv;
if (sm_conn->sm_engine_state == SM_INITIATOR_CONNECTED){
uint16_t ediv;
if (sm_conn->sm_engine_state == SM_INITIATOR_CONNECTED){
switch (sm_conn->sm_irk_lookup_state){
case IRK_LOOKUP_FAILED:
sm_conn->sm_engine_state = SM_INITIATOR_PH1_W2_SEND_PAIRING_REQUEST;
@ -3030,6 +3030,8 @@ void sm_request_pairing(hci_con_handle_t con_handle){
sm_conn->sm_bonding_requested = 1;
break;
}
} else if (sm_conn->sm_engine_state == SM_GENERAL_IDLE){
sm_conn->sm_bonding_requested = 1;
}
}
sm_run();