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.
pull/10952/head
Lingkai Dong 2019-06-05 14:59:20 +01:00 committed by Arto Kinnunen
parent ebede3d401
commit 0372d6e29e
1 changed files with 11 additions and 0 deletions

View File

@ -1424,6 +1424,17 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve
return err;
}
#if defined(TARGET_CORDIO_LL)
// TODO: fix advertising set creation in the link layer.
// The Cordio link layer implements legacy API on top of extended advertising
// and has an issue that no advertising set is created until we set parameters.
// As a workaround, set advertising data again to ensure it takes effect.
err = setAdvertisingData_(this->_advPayload, this->_scanResponse);
if (err) {
return err;
}
#endif
err = _pal_gap.advertising_enable(true);
if (err) {
return err;