Skip to content

Commit 6165204

Browse files
committed
Workaround for legacy GAP advertising issue on Cordio LL
Due to some issue in Cordio link layer, advertising data does not take effect unless we set it (or set it again) after advertising parameters are set.
1 parent f78364c commit 6165204

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,17 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
14241424
return err;
14251425
}
14261426

1427+
#if defined(TARGET_CORDIO_LL)
1428+
// TODO: fix advertising set creation in the link layer.
1429+
// The Cordio link layer implements legacy API on top of extended advertising
1430+
// and has an issue that no advertising set is created until we set parameters.
1431+
// As a workaround, set advertising data again to ensure it takes effect.
1432+
err = setAdvertisingData_(this->_advPayload, this->_scanResponse);
1433+
if (err) {
1434+
return err;
1435+
}
1436+
#endif
1437+
14271438
err = _pal_gap.advertising_enable(true);
14281439
if (err) {
14291440
return err;

0 commit comments

Comments
 (0)