problem in stopping and strating advertisments multiple times

hello,

i have been using nrf52832 with sdk 15.2 , while different interupts occurs i have been changing the advertising bytes with different aid like this

 m_beacon_info[11] = 0x03; 

err_code = sd_ble_gap_adv_stop(m_adv_handle);
APP_ERROR_CHECK(err_code);
advertising_init();
advertising_start();

but in some rare condition two different interupts occurs at the same time so it stops advertisment two times at that time firmware goes to breakpoint is there any way to fix this like, cheak wheather advertisment is already stopped or not so i wont stop the advertisment when second interupt occurs i will wait for first process to get finished and then update the second one.

thanks and regards

manikandan v

Parents
  • Hello,

    Have you tried to see if the program work as expected if you simply ignore the return from sd_ble_gap_adv_stop()?

    e.g.

    (void) sd_ble_gap_adv_stop(m_adv_handle);
    advertising_init();
    advertising_start();

    fix this like, cheak wheather advertisment is already stopped or not so i wont stop the advertisment when second interupt occurs i will wait for first process to get finished and then update the second one.

    What 2 interrupts are there that calls sd_ble_gap_adv_stop()?

    Best regards,

    Vidar

  • hello,

    program works as excepted if i add (void) sd_ble_gap_adv_stop(m_adv_handle); like this.. but is this good way to run aprogram??

    freefall and accelerometer interupts occurs at the same time that calls adv stop

    thanks and regards

    manikandan v

Reply Children
Related