Skip to content

Commit eba5821

Browse files
committed
GenericGap: ensure legacy advertising set exists when setting data
1 parent 2422efc commit eba5821

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
@@ -1782,6 +1782,8 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
17821782
return BLE_ERROR_INVALID_PARAM;
17831783
}
17841784

1785+
prepare_legacy_advertising_set();
1786+
17851787
if (!_existing_sets.get(handle)) {
17861788
return BLE_ERROR_INVALID_PARAM;
17871789
}
@@ -2689,7 +2691,6 @@ bool GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
26892691
template <template<class> class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler>
26902692
void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandler>::prepare_legacy_advertising_set()
26912693
{
2692-
#if BLE_FEATURE_EXTENDED_ADVERTISING
26932694
if (_existing_sets.get(LEGACY_ADVERTISING_HANDLE)) {
26942695
return;
26952696
}
@@ -2699,7 +2700,6 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
26992700
AdvertisingParameters()
27002701
);
27012702
_existing_sets.set(LEGACY_ADVERTISING_HANDLE);
2702-
#endif // BLE_FEATURE_EXTENDED_ADVERTISING
27032703
}
27042704

27052705

0 commit comments

Comments
 (0)