Hi,
I use NRF51822 + S130 + SDK12 platform, my device work in CENTRAL mode, I want send data to peripheral every 10ms, code like this:
while (1)
{
while (m_free_tx_packet_count == 0)
{
//wait free send packet
//m_free_tx_packet_count will increase when BLE_EVT_TX_COMPLETE event received
if (timeout)
{
break;
}
}
if (m_free_tx_packet_count != 0)
{
if(NRF_SUCCESS == ble_nus_c_string_send(...)) //send some datas
{
m_free_tx_packet_count--;
}
}
nrf_delay_ms(10);
}
My system is a realtime system, the peripheral need data received at least once every 300 milliseconds, so I measure the max interval of two ble_nus_c_string_send
function call, then I found sometimes i must wait free send packet more than 400ms, this will cause my system not work well.
So,is there any way to reduce the time between two BLE data send oprator? Or how can i build a real-time system use BLE?