Hi Nordic Team,
Requirement-
Connect->Send 1 packet->Disconnect->Connect...
I am Sending a data packet to central using Timer handler and trying to disconnect using sd_ble_gap_disconnect() in same timer handler.
But i am getting <error> app: ERROR 12290 [Unknown error code] using disconnect function in handler.
Below is the snippet
/*Timer Handler */
static void HT_notification_timeout_handler(void * p_context)
{
bool erase_bonds;
ret_code_t err_code;
UNUSED_PARAMETER(p_context);
sprintf(THL_data,"%d%d%d",10,20,30);
printf("thl_value %s\n",THL_data);
err_code = ble_THL_value_update(&m_cus, &THL_data);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
APP_ERROR_CHECK(err_code);
}
Is it correct to use disconnect function in timer handler ?, or where can i use this function to disconnect after sending a packet to central.
I am using nrf52832 board and sdk 15.2.0
regards