Skip to content

Commit 8268fd0

Browse files
committed
GenericGap: ensure legacy advertising set exists when setting data
1 parent a398e36 commit 8268fd0

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
@@ -1826,6 +1826,8 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
18261826
return BLE_ERROR_INVALID_PARAM;
18271827
}
18281828

1829+
prepare_legacy_advertising_set();
1830+
18291831
if (!_existing_sets.get(handle)) {
18301832
return BLE_ERROR_INVALID_PARAM;
18311833
}
@@ -2733,7 +2735,6 @@ bool GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
27332735
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
27342736
void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::prepare_legacy_advertising_set()
27352737
{
2736-
#if BLE_FEATURE_EXTENDED_ADVERTISING
27372738
if (_existing_sets.get(LEGACY_ADVERTISING_HANDLE)) {
27382739
return;
27392740
}
@@ -2743,7 +2744,6 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
27432744
AdvertisingParameters()
27442745
);
27452746
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
2746-
#endif // BLE_FEATURE_EXTENDED_ADVERTISING
27472747
}
27482748

27492749

0 commit comments

Comments
 (0)