Hi, i am trying to send my notify characteristic every 100 msec, i am using timer for this and when i am connecting to the nrf app, my nordic device is sending the data but after 25-30 sec it is stop transmitting data and disconnect with the "Error8:GATT CONN TIMEOUT". I tried to use the BLE_EVT_TX_COMPLETE event but it still the same. Here some parts of my code:
static void timer_timeout_handler(void * p_context)
{
uint32_t err_code;
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
if(*flag == 1)
{
err_code = char_update(&m_service,(uint8_t *)&acc);
if(err_code == BLE_ERROR_NO_TX_PACKETS)
{
*flag = 0;
}
}
}
}
uint32_t char_update(ble_os_t *p_service, uint8_t *data)
{
ble_gatts_hvx_params_t params;
memset(¶ms, 0, sizeof(params));
params.type = BLE_GATT_HVX_NOTIFICATION;
params.handle = p_seebo->characteristics[seebo_char].char_handle.value_handle;
params.type = BLE_GATT_HVX_NOTIFICATION;
params.offset = 0;
params.p_len = &length;
params.p_data = data;
sd_ble_gatts_hvx(p_seebo->conn_handle, ¶ms);
}
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
uint32_t err_code;
switch (p_ble_evt->header.evt_id)
{
.
.
.
case BLE_EVT_TX_COMPLETE:
*flag = 1;
break;
default:
// No implementation needed.
break;
}
}
Can you please advise me what to do. Thank you.