Tool/software:
I'm using the CC2340R53 with the Basic BLE example, and I want to periodically update the BLE advertising data with sensor values.
To do this, I'm using a separate application thread that sets a flag or sends a message to the BLE thread. Inside the BLE thread, I try to:
-
Call
GapAdv_disable(peripheralAdvHandle_1)
-
Then call
GapAdv_prepareLoadByHandle()
andGapAdv_loadByHandle()
to update the adv data -
Then start advertising again using
GapAdv_enable()
However, GapAdv_disable()
returns bleAlreadyInRequestedMode (0x11)
, which seems to suggest that advertising is already stopped.
Below is my function to stop, initialize and start the advertising again (I have changed the advData1 buffer before calling the below function itself):
return status;
}