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

Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?

I am going to send a sequence of notifications and the documentation provides this information

The API functions that may consume an application packet depending on the parameters supplied to them can be found below:

I am not using the SDK but just SoftDevice (s130 at the moment). What is not clear from the docs is if some of the SoftDevice calls I make, in turn, make calls to sd_ble_l2cap_tx() that I don't know about. It appears to me unlikely that any of the SoftDevice APIs would themselves call sd_ble_gatts_hvx(); that is something only my application is likely to do. So are there 'hidden' sd_ble_l2cap_tx() calls being made or can I safely assume that if my application does not call the method, that the method is never called?

I am trying to figure out the most efficient way to send a sequence of notifications. The documentation suggests two approaches - keeping track of the guaranteed available buffers (fairly involved) or just sending, and if one gets a BLE_ERROR_NO_TX_PACKETS error wait for the BLE_EVT_TX_COMPLETE event.

Related to this question is the error NRF_ERROR_BUSY response. For notifications will that error message ever happen or will I just get a BLE_ERROR_NO_TX_PACKETS error? If I can get both, what is the difference, and how should I behave in the two different cases? With indications the NRF_ERROR_BUSY means call again, or that packet will not get indicated! If notifications can cause that error, then I assume the behavior is the same?

If I chose to notify and always wait for the BLE_EVT_TX_COMPLETE event before the next notification, will this be less efficient? (It is programmatically simpler.)

Parents Reply Children
No Data
Related