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

Is it wrong to send a characteristic notification from inside a timer callback function?

In my application I send a characteristic notification from inside a timer callback function. This causes a restart of my application if I am connected to the board. But my application does not restart if I am not connected. What is happening?

Is it wrong to send a characteristic notification from inside a timer callback function?

Parents
  • No it's fine to send a characteristic notification from inside a timer callback function. As long as the interrupt context you are in is less than the SVC call interrupt priority, it's fine. So either that's not the case and you need to lower the timer interrupt priority, or you are getting an error return from one of your functions, tripping the APP_ERROR_CHECK() and that's what's actually restarting the board.

  • I traced it down and I got error code 13313 (0x3401). I think it was thrown from sd_ble_gatts_hvx().

    After searching old questions I found that I must click the Enable Services button on Master Control Panel.

    Then it worked :-)

    But, is there a way around this so sd_ble_gatts_hvx() wont throw this error if Enable Services is not enabled?

    I don't want my app to crash because of this.

Reply
  • I traced it down and I got error code 13313 (0x3401). I think it was thrown from sd_ble_gatts_hvx().

    After searching old questions I found that I must click the Enable Services button on Master Control Panel.

    Then it worked :-)

    But, is there a way around this so sd_ble_gatts_hvx() wont throw this error if Enable Services is not enabled?

    I don't want my app to crash because of this.

Children
No Data
Related