From 4097998a5799e0c312e596430120a44b174ca310 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 20 Jun 2019 12:07:08 +0200 Subject: [PATCH] att_server: restore persistent ccc only for LE connections on encrpytion change 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 3ae421fd3..f77fe0dd4 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -348,8 +348,8 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin att_server->connection.secure_connection = gap_secure_connection(con_handle); log_info("encrypted key size %u, authenticated %u, secure connectipon %u", att_server->connection.encryption_key_size, att_server->connection.authenticated, att_server->connection.secure_connection); - if (hci_event_packet_get_type(packet) == HCI_EVENT_ENCRYPTION_CHANGE){ - // restore CCC values when encrypted + if (hci_event_packet_get_type(packet) == HCI_EVENT_ENCRYPTION_CHANGE && att_server->peer_addr_type != BD_ADDR_TYPE_CLASSIC){ + // restore CCC values when encrypted for LE Connections if (hci_event_encryption_change_get_encryption_enabled(packet)){ att_server_persistent_ccc_restore(att_server); }