Hi guys,
i have a service with more characteristics and more states. Not every characteristic should be available in each state. Thus there are services which are just allowed in one specific state.
If a device wants to write the wrong characteristic in a state, i just want to disconnect the connection (during the write operation). Is that allowed or is there a good way to disconnect during the write operation?
Like:
if ((p_evt_write->handle == p_ps->char_handle.value_handle) &&
(p_evt_write->len < MAX_DATA_LENGTH) &&
(p_ps->handler_char != NULL))
{
if(incorrectState) { sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); }
}
Thanks in advance! greetings