hci: add gap_set_peer_privacy_mode

This commit is contained in:
Matthias Ringwald 2023-01-12 15:21:10 +01:00
parent 7115cf4e0a
commit c3d19a303e
3 changed files with 16 additions and 0 deletions

View File

@ -1385,6 +1385,13 @@ void gap_delete_bonding(bd_addr_type_t address_type, bd_addr_t address);
* LE Privacy 1.2 - requires support by Controller and ENABLE_LE_RESOLVING_LIST to be defined
*/
/**
* Set Privacy Mode for use in Resolving List. Default: LE_PRIVACY_MODE_DEVICE
* @note Only applies for new devices added to resolving list, please call before startup
* @param privacy_mode
*/
void gap_set_peer_privacy_mode(le_privacy_mode_t privacy_mode );
/**
* @brief Load LE Device DB entries into Controller Resolving List to allow filtering on
* bonded devies with resolvable private addresses

View File

@ -4604,6 +4604,10 @@ void hci_init(const hci_transport_t *transport, const void *config){
hci_stack->iso_packets_to_queue = 1;
#endif
#ifdef ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION
hci_stack->le_privacy_mode = LE_PRIVACY_MODE_DEVICE;
#endif
hci_state_reset();
}
@ -9117,6 +9121,10 @@ uint8_t gap_load_resolving_list_from_le_device_db(void){
}
return ERROR_CODE_SUCCESS;
}
void gap_set_peer_privacy_mode(le_privacy_mode_t privacy_mode ){
hci_stack->le_privacy_mode = privacy_mode;
}
#endif
#ifdef ENABLE_BLE

View File

@ -1247,6 +1247,7 @@ typedef struct {
// LE Resolving List
#ifdef ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION
le_privacy_mode_t le_privacy_mode;
le_resolving_list_state_t le_resolving_list_state;
uint16_t le_resolving_list_size;
uint8_t le_resolving_list_add_entries[(MAX_NUM_RESOLVING_LIST_ENTRIES + 7) / 8];