gap: add gap_extended_advertising_set_resolvable_private_address_update

This commit is contained in:
Matthias Ringwald 2023-07-19 11:35:16 +02:00
parent 027f4677e6
commit 2052d96cc1
3 changed files with 24 additions and 0 deletions

View File

@ -670,6 +670,14 @@ void gap_advertisements_enable(int enabled);
*/
void gap_scan_response_set_data(uint8_t scan_response_data_length, uint8_t * scan_response_data);
/**
* @brief Set update interval for resolvable private addresses generated by the Controller
* @param update_s timeout for updates in seconds
* @return status
*/
uint8_t gap_extended_advertising_set_resolvable_private_address_update(uint16_t update_s);
/**
* @brief Provide storage for new advertising set and setup on Controller
* @param storage to use by stack, needs to stay valid until adv set is removed with gap_extended_advertising_remove

View File

@ -5882,6 +5882,15 @@ static bool hci_run_general_gap_le(void){
btstack_linked_list_iterator_t lit;
#ifdef ENABLE_LE_EXTENDED_ADVERTISING
if (hci_stack->le_resolvable_private_address_update_s > 0){
uint16_t update_s = hci_stack->le_resolvable_private_address_update_s;
hci_stack->le_resolvable_private_address_update_s = 0;
hci_send_cmd(&hci_le_set_resolvable_private_address_timeout, update_s);
return true;
}
#endif
// Phase 1: collect what to stop
#ifdef ENABLE_LE_CENTRAL
@ -8424,6 +8433,12 @@ static le_advertising_set_t * hci_advertising_set_for_handle(uint8_t advertising
return NULL;
}
uint8_t gap_extended_advertising_set_resolvable_private_address_update(uint16_t update_s){
hci_stack->le_resolvable_private_address_update_s = update_s;
hci_run();
return ERROR_CODE_SUCCESS;
}
uint8_t gap_extended_advertising_setup(le_advertising_set_t * storage, const le_extended_advertising_parameters_t * advertising_parameters, uint8_t * out_advertising_handle){
// find free advertisement handle
uint8_t advertisement_handle;

View File

@ -1267,6 +1267,7 @@ typedef struct {
btstack_linked_list_t le_advertising_sets;
uint16_t le_maximum_advertising_data_length;
uint8_t le_advertising_set_in_current_command;
uint16_t le_resolvable_private_address_update_s;
#endif
#endif