Hi,
I need to change advertisement data while advertising. The goal is to set new data for every packet. Firstly, I was trying to put new value like this, but it didn't work:
#... int COUNTER = 1; uint8_t data[] = "123456789123456"; #... // Enter main loop. for (;;) { COUNTER = COUNTER + 1; if (COUNTER == 14) COUNTER = 0; data[3] = (uint8_t) COUNTER; power_manage(); } (modified code from ble tutorial: devzone.nordicsemi.com/.../)
After that, I have read this post: devzone.nordicsemi.com/.../
As I understand now, I was changing memory and that did not make any effect on my advertising. In order to do so, I need to use sd_ble_gap_adv_data_set(). When I try to put it in main loop with COUNTER value as p_data it does not work and I have no idea what is wrong.
What should I change in order to make it work? How can I solve this problem? Are there any other approaches?