This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 BLE/beacon with accelerometer data advertising

Hello,

DK: nrf52840

SDK: 15.0.0

i want to advertise accelerometer data with BLE/Beacon 

so i tried to update the adv. packet for every 10 sec but its not  advertising updated one its showing old data

for example i have updated like this for test purpose

int CUSTOM_SERVICE_UUID_BASE=1111;

***************************************************************

void accinc()
{
nrf_delay_ms(10000);
CUSTOM_SERVICE_UUID_BASE=CUSTOM_SERVICE_UUID_BASE+1111;
}

****************************************************************

int main(void)
{
bool erase_bonds;

// Initialize.
log_init();
timers_init();
buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
peer_manager_init();

// Start execution.
NRF_LOG_INFO("Template example started.");
application_timers_start();

advertising_start(erase_bonds);

// Enter main loop.
while(1)
{
accinc();

services_init();
advertising_init();
conn_params_init();
peer_manager_init();
}
}

plz suggest me the proper way of updating the adv. packet

Related