Skip to content

Commit 26986f4

Browse files
committed
GenericGap: ensure legacy advertising set exists when setting data
1 parent 0e1cbea commit 26986f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,8 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
18021802
return BLE_ERROR_INVALID_PARAM;
18031803
}
18041804

1805+
prepare_legacy_advertising_set();
1806+
18051807
if (!_existing_sets.get(handle)) {
18061808
return BLE_ERROR_INVALID_PARAM;
18071809
}
@@ -2709,7 +2711,6 @@ bool GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
27092711
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
27102712
void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::prepare_legacy_advertising_set()
27112713
{
2712-
#if BLE_FEATURE_EXTENDED_ADVERTISING
27132714
if (_existing_sets.get(LEGACY_ADVERTISING_HANDLE)) {
27142715
return;
27152716
}
@@ -2719,7 +2720,6 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
27192720
AdvertisingParameters()
27202721
);
27212722
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
2722-
#endif // BLE_FEATURE_EXTENDED_ADVERTISING
27232723
}
27242724

27252725

0 commit comments

Comments
 (0)