Hi,
I want to reduce the time required to read 16 KB of data from the datalogger. Currently, it takes about 6 seconds to read all the data. How can I decrease this time?
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(12, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(12, UNIT_1_25_MS)
#define SLAVE_LATENCY 0
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)
///////////////////////////////////////////ALLICATION SEND DATA
for(char i=0;i<66;i++)
{
DATA_SEND_BLUE_TX[0]=i+1;
nrf_fstorage_read(&f_storage,0x28000+i*240, &DATA_SEND_BLUE_TX[1],240);
DATA_SEND_BLUE_TX[241]=Chksum8_2sComplement(&DATA_SEND_BLUE_TX[1],240);
SEND_TO_APP( DATA_SEND_BLUE_TX,242);// 242 //56
}
//////////////////////////////////////////////////////////////////
void SEND_TO_APP(uint8_t * data_array, uint16_t index)
{
uint32_t err_code;
uint16_t length = index; count_send=0;
do
{
err_code = ble_data_send(&m_data, data_array, length, m_conn_handle);
if ((err_code != NRF_ERROR_INVALID_STATE) &&
(err_code != NRF_ERROR_RESOURCES) &&
(err_code != NRF_ERROR_NOT_FOUND))
{
APP_ERROR_CHECK(err_code);
}
count_send++;
} while (err_code == NRF_ERROR_RESOURCES);
}
uint32_t ble_data_send(ble_data_t * p_dat,
uint8_t *p_data,
uint16_t p_length,
uint16_t conn_handle)
{
ble_gatts_value_t gatts_value;
memset(&gatts_value, 0, sizeof(gatts_value));
gatts_value.len = p_length;
gatts_value.offset = 0;
gatts_value.p_value = p_data;
return sd_ble_gatts_value_set(p_dat->conn_handle, p_dat->tx_handles.value_handle, &gatts_value);
}