BLE: Fix random static address storage

pull/13759/head
Vincent Coubard 2020-09-09 22:49:59 +01:00
parent 924f8b1dc9
commit e5128689aa
2 changed files with 8 additions and 4 deletions

View File

@ -351,6 +351,9 @@ Gap::Gap(
mbed::callback(this, &Gap::on_gap_event_received)
);
// Recover static random identity
_random_static_identity_address = _pal_gap.get_random_address();
_pal_gap.set_event_handler(this);
_address_registry.set_event_handler(this);
}
@ -404,12 +407,11 @@ ble_error_t Gap::setRandomStaticAddress(
if (err) {
return err;
}
// FIXME: set random address for active sets
_address_type = own_address_type_t::RANDOM;
}
_address_type = own_address_type_t::RANDOM;
_random_static_identity_address = address;
return BLE_ERROR_NONE;
}

View File

@ -584,6 +584,8 @@ private:
bool _privacy_enabled;
peripheral_privacy_configuration_t _peripheral_privacy_configuration;
central_privacy_configuration_t _central_privacy_configuration;
ble::address_t _random_static_identity_address;
bool _scan_enabled = false;
bool _scan_pending = false;