NimBLE tx data sent callback is not from an interupt.
Posted: Tue Jan 20, 2026 9:52 pm
Hello,
I'm using the nordic UART service and am successfully using it as a bluetooth serial console to an ESP32-S3 on a mobile phone.
My only issue is that sometimes I overrun the internal tx message FIFO and messages get dropped. I was using the ble_gap_event callback to detect when a TX message was sent with BLE_GAP_EVENT_NOTIFY_TX, and thus safe to send another packet. But it seems that this callback is actually called from the same context as ble_gatts_notify_custom when the message is actually placed into the FIFO, NOT when it is sent out through the PHY.
I'm not actually trying to achieve maximum throughput, and my app does not need max throughput. Its just that some console commands generate lots a separate messages and I want a method to queue up each packet before being allowed to send. It seems like the Nimble internal FIFO/queue is around 18 or 19 long.
What can I call to discover the FIFO status? I want to block until it is ok to continue pushing out packets.
Thanks in advance!
I'm using the nordic UART service and am successfully using it as a bluetooth serial console to an ESP32-S3 on a mobile phone.
My only issue is that sometimes I overrun the internal tx message FIFO and messages get dropped. I was using the ble_gap_event callback to detect when a TX message was sent with BLE_GAP_EVENT_NOTIFY_TX, and thus safe to send another packet. But it seems that this callback is actually called from the same context as ble_gatts_notify_custom when the message is actually placed into the FIFO, NOT when it is sent out through the PHY.
I'm not actually trying to achieve maximum throughput, and my app does not need max throughput. Its just that some console commands generate lots a separate messages and I want a method to queue up each packet before being allowed to send. It seems like the Nimble internal FIFO/queue is around 18 or 19 long.
What can I call to discover the FIFO status? I want to block until it is ok to continue pushing out packets.
Thanks in advance!