mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 05:42:49 +00:00
gap: move set random address for adv events into main modify loop
This commit is contained in:
parent
25df6c6155
commit
f66adbded4
22
src/hci.c
22
src/hci.c
@ -4842,23 +4842,6 @@ static bool hci_run_general_gap_le(void){
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_LE_PERIPHERAL
|
|
||||||
#ifdef ENABLE_LE_EXTENDED_ADVERTISING
|
|
||||||
if (hci_extended_advertising_supported()) {
|
|
||||||
btstack_linked_list_iterator_t it;
|
|
||||||
btstack_linked_list_iterator_init(&it, &hci_stack->le_advertising_sets);
|
|
||||||
while (btstack_linked_list_iterator_has_next(&it)){
|
|
||||||
le_advertising_set_t * advertising_set = (le_advertising_set_t*) btstack_linked_list_iterator_next(&it);
|
|
||||||
if ((advertising_set->tasks & LE_ADVERTISEMENT_TASKS_SET_ADDRESS) != 0){
|
|
||||||
advertising_set->tasks &= ~LE_ADVERTISEMENT_TASKS_SET_ADDRESS;
|
|
||||||
hci_send_cmd(&hci_le_set_advertising_set_random_address, advertising_set->advertising_handle, advertising_set->random_address);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_LE_CENTRAL
|
#ifdef ENABLE_LE_CENTRAL
|
||||||
if (hci_stack->le_scanning_param_update){
|
if (hci_stack->le_scanning_param_update){
|
||||||
hci_stack->le_scanning_param_update = false;
|
hci_stack->le_scanning_param_update = false;
|
||||||
@ -4977,6 +4960,11 @@ static bool hci_run_general_gap_le(void){
|
|||||||
hci_send_cmd(&hci_le_remove_advertising_set, advertising_set->advertising_handle);
|
hci_send_cmd(&hci_le_remove_advertising_set, advertising_set->advertising_handle);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if ((advertising_set->tasks & LE_ADVERTISEMENT_TASKS_SET_ADDRESS) != 0){
|
||||||
|
advertising_set->tasks &= ~LE_ADVERTISEMENT_TASKS_SET_ADDRESS;
|
||||||
|
hci_send_cmd(&hci_le_set_advertising_set_random_address, advertising_set->advertising_handle, advertising_set->random_address);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if ((advertising_set->tasks & LE_ADVERTISEMENT_TASKS_SET_PARAMS) != 0){
|
if ((advertising_set->tasks & LE_ADVERTISEMENT_TASKS_SET_PARAMS) != 0){
|
||||||
advertising_set->tasks &= ~LE_ADVERTISEMENT_TASKS_SET_PARAMS;
|
advertising_set->tasks &= ~LE_ADVERTISEMENT_TASKS_SET_PARAMS;
|
||||||
hci_stack->le_advertising_set_in_current_command = advertising_set->advertising_handle;
|
hci_stack->le_advertising_set_in_current_command = advertising_set->advertising_handle;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user