hci: convert le_advertisements_todo.LE_ADVERTISEMENT_TASKS_PARAMS_SET intole_advertiseemnts_state.LE_ADVERTISEMENT_STATE_PARAMS_SET

This commit is contained in:
Matthias Ringwald 2022-01-10 17:28:54 +01:00
parent aaf99a0017
commit 6bf435a6ad
2 changed files with 8 additions and 4 deletions

View File

@ -3687,7 +3687,7 @@ static void hci_state_reset(void){
#endif
#ifdef ENABLE_LE_PERIPHERAL
hci_stack->le_advertisements_active = false;
if ((hci_stack->le_advertisements_todo & LE_ADVERTISEMENT_TASKS_PARAMS_SET) != 0){
if ((hci_stack->le_advertisements_state & LE_ADVERTISEMENT_STATE_PARAMS_SET) != 0){
hci_stack->le_advertisements_todo |= LE_ADVERTISEMENT_TASKS_SET_PARAMS;
}
if (hci_stack->le_advertisements_data != NULL){
@ -6378,7 +6378,8 @@ void gap_scan_response_set_data(uint8_t scan_response_data_length, uint8_t * sca
(void)memcpy(hci_stack->le_advertisements_direct_address, direct_address,
6);
hci_stack->le_advertisements_todo |= LE_ADVERTISEMENT_TASKS_SET_PARAMS | LE_ADVERTISEMENT_TASKS_PARAMS_SET;
hci_stack->le_advertisements_todo |= LE_ADVERTISEMENT_TASKS_SET_PARAMS;
hci_stack->le_advertisements_state |= LE_ADVERTISEMENT_STATE_PARAMS_SET;
hci_run();
}

View File

@ -798,8 +798,11 @@ enum {
LE_ADVERTISEMENT_TASKS_SET_SCAN_DATA = 1 << 1,
LE_ADVERTISEMENT_TASKS_SET_PARAMS = 1 << 2,
LE_ADVERTISEMENT_TASKS_SET_ADDRESS = 1 << 3,
};
enum {
// State
LE_ADVERTISEMENT_TASKS_PARAMS_SET = 1 << 7,
LE_ADVERTISEMENT_STATE_PARAMS_SET = 1 << 0,
};
enum {
@ -1039,7 +1042,7 @@ typedef struct {
bool le_advertisements_enabled_for_current_roles;
uint8_t le_advertisements_todo;
uint8_t le_advertisements_state;
uint16_t le_advertisements_interval_min;
uint16_t le_advertisements_interval_max;
uint8_t le_advertisements_type;