Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_GATTS_EVT_HVN_TX_COMPLETE in relation to characteristic handle

I'm using a custom device which has two services and each of them has one characteristic. I'm using notifications to send data to the other side and on each notification complete I receive a BLE_GATTS_EVT_HVN_TX_COMPLETE event. The issue I'm having is that I need to know for which characteristic this event was triggered so I can prepare the next data (or retry it in case this event is not received). Browsing the code and the data structures it seems no characteristic handle is returned along with this signal unless I'm not seeing something.

A similar question was posted here, but the suggested solution is not an elegant and SDK oriented solution:

 https://devzone.nordicsemi.com/f/nordic-q-a/27425/determine-characteristic-handle-that-caused-ble_gatts_evt_hvn_tx_complete

Any ideas ? Thanks, Marko

  • Hi,

    Notifications will be sent in the order they are placed in the tx buffer. Once it is placed in the buffer it will be (re-) transmitted until it is acknowledged by the peer or you get a disconnect event. So there is no need to retry a transmission unless you are disconnected. The TX complete event will have a number that tells you how many tx buffers where freed. So as suggested in the other post you could count the numbers to keep track of which packets was sent and not.

Related