How to determine if zephyr gatt/att/net_buf are available when sending bluetooth data quickly?

NRF Connect SDK 2.7,  NRF52840

I'm porting the firmware for a shipping product that was originally developed on NRF5 SDK. We are porting out code since the NRF5 SDK is no longer actively developed and we are considering upgrading to NRF54L processor.

The app acts as a bluetooth peripheral with a custom GATT service.  When connected it sometimes transfers several hundred kilobytes of data to the BLE central.  The connection parameters, MTU etc were tuned to achieve a high transfer rate.  The original software sends a series of notifications on a GATT characteristic until NRF_ERROR_RESOURCES was received then waits for BLE_GATTS_EVT_HVN_TX_COMPLETE to resume transmitting.

I'm trying to implement similar on Zephyr. 

Is there any equivalent event to the BLE_GATTS_EVT_HVN_TX_COMPLETE ?

Is there a recommended way to control the data flow in a case like there where the data rate exeeds the capacity of the bluetooth link?  

I'm already making multiple modifications to Zephyr.. can you suggest a place to add an event similar to BLE_GATTS_EVT_HVN_TX_COMPLETE ?

a*

Related