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 have based my service on ble_lbs.c

    Now I added a check in on_write() to see if the cccd was written to so my app can track if the master has enabled notification or not. And I also disable notification after a disconnect. Looks like it is working.

Reply Children
No Data
Related