From 70a390c7e09251d39a245e7c114302be0c95b94b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 29 Jul 2016 11:33:28 +0200 Subject: [PATCH] att_server: check handle in disconnection complete event --- src/ble/att_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;