This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to write to characterstic

hi Nordic support team ,

i  have sent my application  data to nrf connect .I want to send that data when i write something in "write value " option in nrf connect .After comparing that value i want to send my application data.

which other function or code snipet can anyone suggest.

I have chechked that when i try to write in "write value" option ,execution enters this function.I am not able to find where does the value which i send is resceived so that that  i can compare it before sending my application data to nrf connect

static void on_write(ble_mpu_t * p_mpu, ble_evt_t const * p_ble_evt)
{
ble_gatts_evt_write_t const * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;

if ( (p_evt_write->handle == p_mpu->accel_char_handles.cccd_handle)
&& (p_evt_write->len == 2))
{
if (ble_srv_is_notification_enabled(p_evt_write->data))
{
p_mpu->is_notification_enabled = true;
SEGGER_RTT_printf(0,"ON WRITE \n");
}
else
{
p_mpu->is_notification_enabled = false;
}
}
}

Thank you Nordic team 

Related