Hello,
We are developing a feature on our product that allows us to dump data from an external flash memory.
I'm using a custom characteristic with notification to dump the data over BLE.
If i'm calling sd_ble_gatts_hvx and then waiting for the BLE_GATTS_EVT_HVN_TX_COMPLETE before calling again sd_ble_gatts_hvx, all is working fine, but the transfer is very slow and it seems to be limited by the connection interval (that is supposed to be fixed by the central : 7.5ms with a NRF52840 dongle, 30ms with my pixel 6). I'm sending packet of 180 bytes.
==> sd_ble_gatts_hvx
==> wait BLE_GATTS_EVT_HVN_TX_COMPLETE
==> sd_ble_gatts_hvx
==> wait BLE_GATTS_EVT_HVN_TX_COMPLETE
==> [...]
Then, I tried something else. At the bery begining of the transfer, i'm calling sd_ble_gatts_hvx 3 times (without waiting for BLE_GATTS_EVT_HVN_TX_COMPLETE), then the transfer continue as previously (waiting for BLE_GATTS_EVT_HVN_TX_COMPLETE before calling again sd_ble_gatts_hvx)
==> sd_ble_gatts_hvx
==> sd_ble_gatts_hvx
==> sd_ble_gatts_hvx
==> wait BLE_GATTS_EVT_HVN_TX_COMPLETE
==> sd_ble_gatts_hvx
==> wait BLE_GATTS_EVT_HVN_TX_COMPLETE
==> sd_ble_gatts_hvx
==> wait BLE_GATTS_EVT_HVN_TX_COMPLETE
==> [...]
In that case, I have noticed that the transfer is going much faster ! I know that sd_ble_gatts_hvx can befferize data, but why is it faster ? I want to know if i'm doing something wrong by calling sd_ble_gatts_hvx several time while it returns NRF_SUCCESS without waiting for BLE_GATTS_EVT_HVN_TX_COMPLETE.
Thank you in advance,
Best regards,
Aurélien