Skip to content

Commit 78468fb

Browse files
committed
BLE: Use RANDOM address per default for Advertising, Scan and Connection parameter.
Unlike the public address, the RANDOM address is guaranteed to exist. If privacy is enabled, it means the controller will generates random resolvable addresses or non resolvable addresses depending on the config. If privacy is not enabled then the device will use the device's random static address that doesn't change between radio processes.
1 parent e7ef0b7 commit 78468fb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

features/FEATURE_BLE/ble/gap/AdvertisingParameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class AdvertisingParameters {
135135
_minInterval(minInterval),
136136
_maxInterval(maxInterval),
137137
_peerAddressType(target_peer_address_type_t::PUBLIC),
138-
_ownAddressType(own_address_type_t::PUBLIC),
138+
_ownAddressType(own_address_type_t::RANDOM),
139139
_policy(advertising_filter_policy_t::NO_FILTER),
140140
_primaryPhy(phy_t::LE_1M),
141141
_secondaryPhy(phy_t::LE_1M),

features/FEATURE_BLE/ble/gap/ScanParameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class ScanParameters {
121121
scan_window_t scan_interval = scan_interval_t::min(),
122122
scan_interval_t scan_window = scan_window_t::min(),
123123
bool active_scanning = false,
124-
own_address_type_t own_address_type = own_address_type_t::PUBLIC,
124+
own_address_type_t own_address_type = own_address_type_t::RANDOM,
125125
scanning_filter_policy_t scanning_filter_policy = scanning_filter_policy_t::NO_FILTER
126126
) :
127127
own_address_type(own_address_type),

features/FEATURE_BLE/source/gap/ConnectionParameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ConnectionParameters::ConnectionParameters(
3030
conn_event_length_t maxEventLength
3131
) :
3232
_filterPolicy(initiator_filter_policy_t::NO_FILTER),
33-
_ownAddressType(own_address_type_t::PUBLIC)
33+
_ownAddressType(own_address_type_t::RANDOM)
3434
{
3535
for (uint8_t i = 0; i < MAX_PARAM_PHYS; ++i) {
3636
_enabledPhy[i] = false;

0 commit comments

Comments
 (0)