att_server: wait until central re-encryption is complete

This commit is contained in:
Matthias Ringwald 2018-05-14 17:34:24 +02:00
parent dcd6c9b595
commit 0234fbbca9

View File

@ -221,7 +221,8 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin
att_server_persistent_ccc_restore(att_server);
}
}
break;
att_run_for_context(att_server);
break;
case HCI_EVENT_DISCONNECTION_COMPLETE:
// check handle
@ -413,6 +414,9 @@ static void att_run_for_context(att_server_t * att_server){
switch (att_server->state){
case ATT_SERVER_REQUEST_RECEIVED:
// wait until re-encryption as central is complete
if (gap_reconnect_security_setup_active(att_server->connection.con_handle)) break;
// wait until pairing is complete
if (att_server->pairing_active) break;