Hello everyone,
I would like to update my advertising data How can I update this data for each adv packet?
I use radio_notification_init (SDK 12)
void serviceAdvertiseUpdate(void)
{
sd_ble_gap_adv_stop();
advertising_init();
ble_advertising_start(BLE_ADV_MODE_FAST);
}
bool current_radio_active_state = false;
void ble_on_radio_active_evt(bool radio_active)
{
uint8_t data;
static uint8_t count = 0;
current_radio_active_state = radio_active;
if(current_radio_active_state) {
//if(count++ > 5) {//0.3*4 = 1.2sec
serviceAdvertiseUpdate();
// count = 0;
//}
}
}
void radio_notification_init(void)
{
uint32_t err_code;
err_code = ble_radio_notification_init(2,
NRF_RADIO_NOTIFICATION_DISTANCE_2680US,
ble_on_radio_active_evt);
APP_ERROR_CHECK(err_code);
}