I added periodic advertsing to my simple_peripheral like in https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1294888/faq-cc2642r-periodic-advertising-with-cc2642r-cc2652r7.
Everything is running fine!
Additionally, I want to change the periodic advertising params (interval) later during runtime. The new settings can be set by user via GATT Service.
Therefore, I call GapAdv_SetPeriodicAdvParams again:
uint32_t newInterval = getNewInterval(); // Change Periodic Advertising parameters GapAdv_periodicAdvParams_t perParams = {newInterval, newInterval, 0x40}; status = GapAdv_SetPeriodicAdvParams(advHandleNCNS, &perParams);
The status is always 0x18 (bleInvalidRange). The function only succeeds for the very first call after creating the advertising.
I also tried to pause the periodic advertising by calling GapAdv_SetPeriodicAdvEnable(0, advHandleNCNS) and/or GapAdv_disable(advHandleNCNS) before calling GapAdv_SetPeriodicAdvParams again. With no success.
The only way now is doing a reset, but I want to avoid this.
Is it possible to change the initial periodic advertising params to new values during runtime? If yes, I would appreciate any help!
Many thanks in advance!