mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Fix random static address storage
parent
924f8b1dc9
commit
e5128689aa
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue