I'm attempting to transfer 256K bps (1 244-byte notification every ~7.5ms) using an nRF52840 using Notifications and am not getting close to the necessary bandwidth. I'm getting the (dreaded) NRF_ERROR_RESOURCES error and have a few questions about the way that the S140 soft devices handles notifications: I used sd_ble_gap_phy_update to specify BLE_GAP_PHY_2MBPS after receiving the BLE_GAP_EVT_CONNECTED event. I also set BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT to 20. My questions (so far):
- When a characteristic value is sent using a Notification (via sd_ble_gatts_hvx), a pointer to the ble_gatts_hvx_params_t structure is sent. In sd_ble_gatts_hvx, is this information copied, or, if BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT is greater than 1 (eg. 20) should an array of ble_gatts_hvx_params_t be created and used for this information? In other words, if more than 1 Notification can be queued, is the information sent to sd_ble_gatts_hvx queued internally or should I maintain an array?
- When > 1 Notifications can be queued, are the associated characteristic values always sent in the order submitted?
- I increased the mtu size (NRF_SDH_BLE_GATT_MAX_MTU_SIZE) to 247 (as shown in several examples). Is this a hard upper limit, or can the mtu size be increased to get additional bandwidth?
- I also increased NRF_SDH_BLE_GAP_DATA_LENGTH to 251 (as shown in several examples). Is this the equivalent to enabling DLE? If not, what specifically must be done?
- When the event BLE_GATTS_EVT_HVN_TX_COMPLETE is issued, what value is passed in the p_context argument? Is this the pointer to the ble_gatts_hvx_params_t structure that was sent with the associated call to sd_ble_gatts_hvx that initiated the Notification?
- Is there any detailed documentation that I can read to help optimize the S140 with my application?
Thanks!