Hello
Here is an overview of an issue we are having with our BLE project right now. I am not familiar enough with it to be able to explain it very clearly right now, but I will follow up with more information soon.
We have a BLE application running on an nRF52833.
The project was initially created from an nRF example application, in Keil uVision (I don’t know which application is was example created from, but I will find out).
The nRF device uses the Nordic UART Service to send the data to the iOS app, specifically this function:
ble_nus_data_send()
An iOS app connects to the nRF device, and the nRF device sends data to the iOS app.
The nRF device has one sample of approx. 230 bytes ready to send every 16 msec, which is enough to send in one PDU.
The connection was established using the 2Mbit PHY and, up to and including iOS 15, the device managed to stream all its data “live” to the iOS app. This is because the connection interval established between the iOS app and the nRF device was 10 or 15 ms (I am not sure which).
However, since iOS 16, when I look at the Connect Event parameters sent by the iOS app, the Connection Interval is 30 ms, with a Window Size of 3.75 ms.
So now the nRF device seems to have a backlog of data to send. Eventually all the data is transmitted, but, for example, what used to be sent “live” in 10 seconds, now takes 20+ seconds.
Theoretically, there should be time for the slave / nRF device to send multiple packets within that 3.75 ms window of time.
So, I have a few questions (if you have enough information):
Is there a mechanism within the Nordic UART Service to send multiple packets during the one Connection Interval? If so, is it dependent on some defines - e.g. a buffer/array size?
Also, looking at the logic of the code that is trying to send data to the iOS app, essentially it is this:
- Call ble_nus_data_send() to send data.
- If the return value is NRF_SUCCESS, all good.
- If the return value is NRF_ERROR_RESOURCES or NRF_ERROR_BUSY, then try again when
- nus_data_handler() indicates an BLE_NUS_EVT_TX_RDY event
In this way, the code keeps trying to stuff data in to the UART, whenever it has data, and whenever the BLE_NUS_EVT_TX_RDY event is indicated.
Something must be wrong with this logic, because if it was correct, then maybe the nRF device would manage to send more than one PDU within the 3.75 ms window that it has during each Connection Interval.
I don't know if I have given enough clear / correct information for you to offer an opinion, but please do if I have
Regards
Garrett