Hi
I had a problem which I want to send many packets in a loop using sd_ble_gatts_hvx(), but when the number is 5, the error code(NRF_ERROR_RESOURCES) is happened. Then I used the BLE_GATTS_EVT_HVN_TX_COMPLETE to send other packets. But there are three questions. Firstly, when I send 4 packets ,could the BLE_GATTS_EVT_HVN_TX_COMPLETE be carried on 4 timers? Secondly, 4 packets may be the limit of BLE buffer, Can I revise it? Finally, I send 160 packets, because the rate of BLE is 1Mbps, the packets could be spent about 20ms. But that's not case. Why? Thanks for your answer.
for(j = 0;j < 160 ;j++)
{
..................
err_code = ble_lbs_on_button_change(m_conn_handle, &m_lbs, 0);
if(err_code == NRF_ERROR_RESOURCES)
break;
if(err_code != NRF_SUCCESS &&
err_code != BLE_ERROR_INVALID_CONN_HANDLE &&
err_code != NRF_ERROR_INVALID_STATE &&
err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
{
APP_ERROR_CHECK(err_code);
}
................
}