Skip to content

Commit eeb14c5

Browse files
committed
BLE - Conditionally include address rotation at compile time
1 parent 632851e commit eeb14c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,10 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
570570
_advertising_timeout.detach();
571571
state.advertising = false;
572572

573+
#if BLE_FEATURE_PRIVACY
573574
// Stop address rotation if required
574575
set_random_address_rotation(false);
576+
#endif
575577

576578
return BLE_ERROR_NONE;
577579
}
@@ -598,8 +600,10 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
598600
return err;
599601
}
600602

603+
#if BLE_FEATURE_PRIVACY
601604
// Stop address rotation if required
602605
set_random_address_rotation(false);
606+
#endif
603607

604608
_scan_timeout.detach();
605609

@@ -1599,7 +1603,9 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
15991603
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
16001604
if (!is_extended_advertising_available()) {
16011605
_pal_gap.scan_enable(false, false);
1606+
#if BLE_FEATURE_PRIVACY
16021607
set_random_address_rotation(false);
1608+
#endif
16031609
}
16041610

16051611
_scan_enabled = false;
@@ -1637,8 +1643,10 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
16371643
// TODO: define the mechanism signaling the error
16381644
}
16391645

1646+
#if BLE_FEATURE_PRIVACY
16401647
// Stop address rotation if required
16411648
set_random_address_rotation(false);
1649+
#endif
16421650

16431651
BLE_DEPRECATED_API_USE_BEGIN()
16441652
LegacyGap::processTimeoutEvent(LegacyGap::TIMEOUT_SRC_ADVERTISING);
@@ -1837,8 +1845,10 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
18371845
_advertising_timeout.detach();
18381846
_pal_gap.advertising_enable(false);
18391847

1848+
#if BLE_FEATURE_PRIVACY
18401849
// Stop address rotation if required
18411850
set_random_address_rotation(false);
1851+
#endif
18421852
}
18431853
#endif // BLE_ROLE_PERIPHERAL
18441854

0 commit comments

Comments
 (0)