This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Dynamically changing advertisement data

Hello,

I have an broadcaster/peripheral in which I am trying to modify a dummy value in its advertisement data (manufacturer specific) (every 100ms) so that my observer/peripheral doesn't miss a single advertisement packet. I have a performPeriodicTask() function in which I include the following code:

uint8 advertEnabled = FALSE;

GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8), &advertEnabled );

bStatus_t ret;

advertData[26] = !advertData[26];

ret = GAP_UpdateAdvertisingData( TaskID, TRUE, sizeof( advertData ), advertData);

//turn advertising on back again

advertEnabled = TRUE;

GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED , sizeof( uint8 ), &advertEnabled );

However, when testing with Light Blue app, I expect that everytime I connect, disconnect and connect back again to the broadcaster/peripheral,a change in that dummy value is made. But no change is made everytime I test. I tried several times because I thought that it may be that I'm just always connecting when the last change was to a 1, but nothing.


Nonetheless, I notice that when I change one field in my service, which also updates the manufacturer specific part of my advertisement data (using the same code above, except for advertData[26]), then the other dummy value changes, but stays there until I change this field in my service again.

 How can I just make this dummy value in the adv. data to change independently every 100ms?