Hello,
I'd like to understand a bit more about transmit buffers for sd_ble_gatts_hvx() calls. Our peripheral application is developed using SDK 15.3.0 and S112 for nRF52832 and is based originally on the ble_app_uart example.
For S112, BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT is 1. For our app, NRF_SDH_BLE_GATT_MAX_MTU_SIZE is set low at 23, NRF_SDH_BLE_GAP_EVENT_LENGTH is 6 (7.5 ms) and min/max connection intervals are 60/120 ms. When iOS device is the connected central, 120 ms is the selected connection interval. Peripheral and central exchange at most 19 bytes of data at a time.
Our application has low data throughput, but there is the possibility of two or three calls to sd_ble_gatts_hvx() (notification) in quick succession. I understand that if no buffers are available, sd_ble_gatts_hvx() will return NRF_ERROR_RESOURCES and the app should wait for BLE_GATTS_EVT_HVN_TX_COMPLETE event then try again. Given:
NRF_SDH_BLE_GATT_MAX_MTU_SIZE is 23
NRF_SDH_BLE_GAP_EVENT_LENGTH is 6 (7.5 ms)
connection interval is 120 ms
how many notifications can be handled in each connection event? I'm trying to determine if our app needs to handle NRF_ERROR_RESOURCES error from sd_ble_gatts_hvx(). Or can we be confident this will never happen given above parameters?
Should I consider increasing NRF_SDH_BLE_GAP_EVENT_LENGTH? I've read that doing so will increase the number of tx buffers available.
Our application uses the time slot API for radio use in between BLE activity and I assume that the larger connection interval (120 ms) with short connection event length (7.5 ms) increases interoperability of BLE with time slot API usage.
Many thanks,
Tim