1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-02-03 20:54:18 +00:00

gap: improve name and use bool for whitelist_modification_pending

This commit is contained in:
Matthias Ringwald 2020-08-14 17:18:26 +02:00
parent 13eb2a2e39
commit 85076d74c4

@ -3692,20 +3692,20 @@ static bool hci_run_general_gap_le(void){
// check if whitelist needs modification
btstack_linked_list_iterator_t lit;
int modification_pending = 0;
bool whitelist_modification_pending = false;
btstack_linked_list_iterator_init(&lit, &hci_stack->le_whitelist);
while (btstack_linked_list_iterator_has_next(&lit)){
whitelist_entry_t * entry = (whitelist_entry_t*) btstack_linked_list_iterator_next(&lit);
if (entry->state & (LE_WHITELIST_REMOVE_FROM_CONTROLLER | LE_WHITELIST_ADD_TO_CONTROLLER)){
modification_pending = 1;
whitelist_modification_pending = true;
break;
}
}
if (modification_pending){
if (whitelist_modification_pending){
#ifdef ENABLE_LE_CENTRAL
// stop connnecting if modification pending
// stop connecting if modification pending
if (hci_stack->le_connecting_state != LE_CONNECTING_IDLE){
hci_send_cmd(&hci_le_create_connection_cancel);
return true;