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

P_evt_write handle doesn't match

Hi,

I have a basic characteristic on which I would like to write. I did this on so many projects without any problem but here, the value handle of my characteristic doesn't match with the expected one.

static void on_write(ble_acs_t * p_acs, ble_evt_t * p_ble_evt)
{
  ble_gatts_evt_write_t * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
  NRF_LOG_ERROR("p_evt_write handle %d  reset handle %d\n",p_evt_write->handle, p_acs->reset_handles.value_handle);
  if ( (p_evt_write->handle == p_acs->reset_handles.value_handle) && (p_evt_write->len == ACCEL_RESET_CHAR_MAX_LEN) ) {

    if(p_evt_write->data[0] == 0x01)
    {
        reset_flag = true;
    }

  } 
  
}

Example : p_evt_write_handle is equal to 24 and p_acs->reset_handles.value_handle is equal to 117. Furthermore, this value is really weird because it seems to be too high. I only have 1 service and 3 characteristics so 117 ...

Any idea? I think that I missed something

Related