diff --git a/src/ble/att_server.c b/src/ble/att_server.c index dd90782c5..7ba1ef64c 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -330,8 +330,6 @@ static void att_server_event_packet_handler (uint8_t packet_type, uint16_t chann att_server->ir_le_device_db_index = sm_le_device_index(con_handle); att_server->ir_lookup_active = 0u; att_server->pairing_active = 0u; - // notify all - old - att_emit_event_to_all(packet, size); // notify all - new att_emit_connected_event(att_server, att_connection); break; @@ -340,6 +338,18 @@ static void att_server_event_packet_handler (uint8_t packet_type, uint16_t chann } break; + case HCI_EVENT_LE_META: + switch (hci_event_le_meta_get_subevent_code(packet)) { + case HCI_SUBEVENT_LE_CONNECTION_COMPLETE: + // forward LE Connection Complete event to keep backward compatibility + // deprecated: please register hci handler with hci_add_event_handler or handle ATT_EVENT_CONNECTED + att_emit_event_to_all(packet, size); + break; + default: + break; + } + break; + case HCI_EVENT_ENCRYPTION_CHANGE: case HCI_EVENT_ENCRYPTION_CHANGE_V2: case HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE: