mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
gap: add gap_secure_connection to check if encryption key results from LE Secure Connection Pairing
This commit is contained in:
parent
3dc3a67de7
commit
f1dfbe18c8
@ -428,6 +428,13 @@ int gap_encryption_key_size(hci_con_handle_t con_handle);
|
||||
*/
|
||||
int gap_authenticated(hci_con_handle_t con_handle);
|
||||
|
||||
/**
|
||||
* @brief Get secure connection property
|
||||
* @param con_handle
|
||||
* @return 1 if bonded usiung LE Secure Connections
|
||||
*/
|
||||
int gap_secure_connection(hci_con_handle_t con_handle);
|
||||
|
||||
/**
|
||||
* @brief Queries authorization state.
|
||||
* @param con_handle
|
||||
|
@ -5001,6 +5001,13 @@ int gap_authenticated(hci_con_handle_t con_handle){
|
||||
return sm_conn->sm_connection_authenticated;
|
||||
}
|
||||
|
||||
int gap_secure_connection(hci_con_handle_t con_handle){
|
||||
sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
|
||||
if (!sm_conn) return 0; // wrong connection
|
||||
if (!sm_conn->sm_connection_encrypted) return 0; // unencrypted connection cannot be authenticated
|
||||
return sm_conn->sm_connection_sc;
|
||||
}
|
||||
|
||||
authorization_state_t gap_authorization_state(hci_con_handle_t con_handle){
|
||||
sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
|
||||
if (!sm_conn) return AUTHORIZATION_UNKNOWN; // wrong connection
|
||||
|
Loading…
x
Reference in New Issue
Block a user