Updating Manufacturer Data in Advertised Packet is not Working

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

Thanks

Rich

void DynamicADVPayloadUpdate(void)

{

   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;

           

            CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData, cyBle_discoveryModeInfo.scanRspData);

        }

    }

}

0 Likes
1 Solution
Anonymous
Not applicable

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?

Thanks

Rich

View solution in original post

0 Likes
4 Replies
Anonymous
Not applicable

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?

Thanks

Rich

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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.

Anonymous
Not applicable

Thanks for the help.

Rich

0 Likes