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)
|
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);
|
_pal_gap.set_event_handler(this);
|
||||||
_address_registry.set_event_handler(this);
|
_address_registry.set_event_handler(this);
|
||||||
}
|
}
|
||||||
|
@ -404,11 +407,10 @@ ble_error_t Gap::setRandomStaticAddress(
|
||||||
if (err) {
|
if (err) {
|
||||||
return 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;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -584,6 +584,8 @@ private:
|
||||||
bool _privacy_enabled;
|
bool _privacy_enabled;
|
||||||
peripheral_privacy_configuration_t _peripheral_privacy_configuration;
|
peripheral_privacy_configuration_t _peripheral_privacy_configuration;
|
||||||
central_privacy_configuration_t _central_privacy_configuration;
|
central_privacy_configuration_t _central_privacy_configuration;
|
||||||
|
ble::address_t _random_static_identity_address;
|
||||||
|
|
||||||
|
|
||||||
bool _scan_enabled = false;
|
bool _scan_enabled = false;
|
||||||
bool _scan_pending = false;
|
bool _scan_pending = false;
|
||||||
|
|
Loading…
Reference in New Issue