diff --git a/src/ble/att_server.c b/src/ble/att_server.c index ed657e630..b4db34c18 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -174,11 +174,11 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin break; case HCI_EVENT_DISCONNECTION_COMPLETE: + // check handle + if (att_connection.con_handle != hci_event_disconnection_complete_get_connection_handle(packet)) break; att_clear_transaction_queue(&att_connection); att_connection.con_handle = 0; att_handle_value_indication_handle = 0; // reset error state - // restart advertising if we have been connected before - // -> avoid sending advertise enable a second time before command complete was received att_server_state = ATT_SERVER_IDLE; break;