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

Events/result codes when notifications fail

I'm looking for a way to reliably determine (from the applications viewpoint) if a notification was successfully transmitted. Currently, we're having some issues when the link is weak and it eventually times out and disconnects.

Are there any mechanism, other than the final disconnect, that the transmission is failing? E.g. a result code from ble_gatts_hvx() or an event, other than BLE_GAP_EVT_DISCONNECTED? I have concluded that BLE_GATTS_EVT_TIMEOUT will not be generated for notifications - correct?

S132 v3.0.0

Parents
  • Hi

    The link layer sends notifications as commands rather than requests, which means that they don't have an explicit timeout, and no timeout event will be generated. 

    The only way a notification can be lost is if you have a link loss, which is what is happening in your case, triggering the disconnected event. 

    While you don't get any events on a missing notification, you will get an event when one or more notifications are ACK'ed by the client. In this case the BLE_EVT_TX_COMPLETE will be sent, informing you that a certain number of notifications were successfully sent. 

    If you send a notification and see that this event never occurs then it means the notification still hasn't been ACK'ed by the client, and is pending in the SoftDevice buffers. If this happens over several connection intervals it is typically a sign that the link is poor. 

    Best regards
    Torbjørn 

Reply Children
No Data
Related