I am using the code from the Dynamic Broadcaster project. I have created Manufacturer bytes in both the advertised packet and in the scan packet. I am not seeing them change...
CyBle_GapUpdateAdvData is not returning an error. I am not using low power modes.
static uint32_t count = 0;
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
count++; /* Loop counter */
/* Once the system enters Sleep/Deepsleep mode during advertisement, the source of wake-up is the next
* advertisement interval which has a wakeup interval of 1 advertisement (ADV) interval (100ms).
* LOOP_DELAY * ADV interval is the interval after which ADV data is updated in this firmware.*/
if(count >= LOOP_DELAY)
/* Dynamic payload will be continuously updated */
advPayload[MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX] = dynamicPayload++;
if(dynamicPayload == MAX_PAYLOAD_VALUE)
dynamicPayload = MIN_PAYLOAD_VALUE;
count = 0;
Solved! Go to Solution.
I have it working, I had the MANUFACTURER_SPECIFIC_DYNAMIC_DATA_INDEX set incorrectly. What is the best way to time the updates of advertised data? To update the data midway between advertisements?
The CYBLE_BLESS_STATE_EVENT_CLOSE is about the closest to timing imo, as it directly correlates with the BLESS event finished state.
Knowing the values of the advertisement period you set however, you could implement some code to get the first CYBLE_BLESS_STATE_EVENT_CLOSE reading, set a timer for (advertisement period - advertisement window) divided by two to have the timer fire at half way through the down-time of the advertisement period. Otherwise, just matching to the close event will be good enough depending on what you are trying to do.
Yes, the advertisement data has to be updated in between advertisement intervals. However, you could update at any instant between the events: just after the previous event or just before the upcoming event or midway between the events.