Hi,
The BLE event length and the utilization of the notification buffer determine how many packets you can send per connection event. Have you tried to increase the NRF_SDH_BLE_GAP_EVENT_LENGTH symbol in sdk_config.h? Around '12' should be sufficient to maximize throughput with default MTU/DLE. Also, note that the number of packets may be limited by the GAP central, so you may get more packets through if you test with nRF connect on Android or iOS.
nRF connect on Android, iOS or PC? Also, which SDK version is this project based on?
hi vidar,the nRF connect on Android and sdk 13.1,Today, I found that when I sent the sd_ble_gatts_hvx function to send data, when I sent it to the 5th package, I returned the NRF_ERROR_RESOURCES status. Do you know what the reason is? I look forward to your reply, thank you.
Hi,
NRF_ERROR_RESOURCES means you have run out of tx buffers in the Softdevice and that you need to wait for "tx complete" event before queueing more packets as illustrated by the message sequence chart: GATTS Handle Value Notification.
You may increase the notification queue size and event length through sd_ble_cfg_set() in ble_stack_init(). The configuration option in sdk_config.h I mentioned earlier is not available in this SDK version. But note that the number of packets you can send per event varies between phones and what chipset they use. We have tested a selection of phones internally for this, see section 4.5 of the pdf uploaded here to see the results.
Hi,
NRF_ERROR_RESOURCES means you have run out of tx buffers in the Softdevice and that you need to wait for "tx complete" event before queueing more packets as illustrated by the message sequence chart: GATTS Handle Value Notification.
You may increase the notification queue size and event length through sd_ble_cfg_set() in ble_stack_init(). The configuration option in sdk_config.h I mentioned earlier is not available in this SDK version. But note that the number of packets you can send per event varies between phones and what chipset they use. We have tested a selection of phones internally for this, see section 4.5 of the pdf uploaded here to see the results.