In uart_event_handle case APP_UART_DATA_READY
UNUSED_VARIABLE(app_uart_get(&data_array[array_index]));
if ((array_index >= 240))
{
memcpy(Ble_array_to_apk, data_array, sizeof(data_array));
memset(data_array, 0, sizeof(data_array));
overflowflag = true;
length = array_index;
array_index = 0;
}
In main fun inside for loop
if (overflowflag == true)
{
sequence += 1;
overflowflag = false;
err_code = ble_nus_data_send(&m_nus, Ble_array_to_apk, &length, m_conn_handle);
memset(Ble_array_to_apk, 0, sizeof(Ble_array_to_apk));
}
err_code is success and also data loss is happen
In stm32 transmitting 240 bytes with 20ms timer