att_db: track sc flag

This commit is contained in:
Matthias Ringwald 2019-03-06 15:10:45 +01:00
parent 3224a7f690
commit 13eb7322ff
2 changed files with 5 additions and 1 deletions

View File

@ -69,6 +69,7 @@ typedef struct att_connection {
uint8_t encryption_key_size;
uint8_t authenticated;
uint8_t authorized;
uint8_t secure_connection;
} att_connection_t;
// ATT Client Read Callback for Dynamic Data

View File

@ -242,6 +242,9 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin
if (!att_server) break;
att_server->connection.encryption_key_size = gap_encryption_key_size(con_handle);
att_server->connection.authenticated = gap_authenticated(con_handle);
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_encryption_change_get_encryption_enabled(packet)){
@ -1020,4 +1023,4 @@ uint16_t att_server_get_mtu(hci_con_handle_t con_handle){
att_server_t * att_server = att_server_for_handle(con_handle);
if (!att_server) return 0;
return att_server->connection.mtu;
}
}