@@ -570,8 +570,10 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
570
570
_advertising_timeout.detach ();
571
571
state.advertising = false ;
572
572
573
+ #if BLE_FEATURE_PRIVACY
573
574
// Stop address rotation if required
574
575
set_random_address_rotation (false );
576
+ #endif
575
577
576
578
return BLE_ERROR_NONE;
577
579
}
@@ -598,8 +600,10 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
598
600
return err;
599
601
}
600
602
603
+ #if BLE_FEATURE_PRIVACY
601
604
// Stop address rotation if required
602
605
set_random_address_rotation (false );
606
+ #endif
603
607
604
608
_scan_timeout.detach ();
605
609
@@ -1599,7 +1603,9 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
1599
1603
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
1600
1604
if (!is_extended_advertising_available ()) {
1601
1605
_pal_gap.scan_enable (false , false );
1606
+ #if BLE_FEATURE_PRIVACY
1602
1607
set_random_address_rotation (false );
1608
+ #endif
1603
1609
}
1604
1610
1605
1611
_scan_enabled = false ;
@@ -1637,8 +1643,10 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
1637
1643
// TODO: define the mechanism signaling the error
1638
1644
}
1639
1645
1646
+ #if BLE_FEATURE_PRIVACY
1640
1647
// Stop address rotation if required
1641
1648
set_random_address_rotation (false );
1649
+ #endif
1642
1650
1643
1651
BLE_DEPRECATED_API_USE_BEGIN ()
1644
1652
LegacyGap::processTimeoutEvent (LegacyGap::TIMEOUT_SRC_ADVERTISING);
@@ -1837,8 +1845,10 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
1837
1845
_advertising_timeout.detach ();
1838
1846
_pal_gap.advertising_enable (false );
1839
1847
1848
+ #if BLE_FEATURE_PRIVACY
1840
1849
// Stop address rotation if required
1841
1850
set_random_address_rotation (false );
1851
+ #endif
1842
1852
}
1843
1853
#endif // BLE_ROLE_PERIPHERAL
1844
1854
0 commit comments