mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 17:42:51 +00:00
hci: fix call to hci_whitelist_add when entry on controller but scheduled for removal
This commit is contained in:
parent
b6d1479553
commit
287379cc24
@ -5449,8 +5449,13 @@ static uint8_t hci_whitelist_add(bd_addr_type_t address_type, const bd_addr_t ad
|
||||
if (memcmp(entry->address, address, 6) != 0) {
|
||||
continue;
|
||||
}
|
||||
// already in there
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
// disallow if already scheduled to add
|
||||
if ((entry->state & LE_WHITELIST_ADD_TO_CONTROLLER) != 0){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
// still on controller, but scheduled to remove -> re-add
|
||||
entry->state |= LE_WHITELIST_ADD_TO_CONTROLLER;
|
||||
return ERROR_CODE_SUCCESS;
|
||||
}
|
||||
// alloc and add to list
|
||||
whitelist_entry_t * entry = btstack_memory_whitelist_entry_get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user