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

NRF openmesh BLE_ERROR_INVALID_CONN_HANDLE

Hello,

I am currently working with NRF openmesh but when I try to set a new handle i get an error. This is what I tried.

uint8_t ledje = 0x01;
rbc_mesh_value_handle_t led;
rbc_mesh_value_set(led, &ledje, sizeof(ledje));
rbc_mesh_value_enable(led);

However it seems that it hangs at mesh_gatt_value_set with the error : BLE_ERROR_INVALID_CONN_HANDLE.

What am I doing wrong here?

Thanks in advance,

Tim Smits

Parents
  • You need to be in a valid connection when using rbc_mesh_value_set().

    When you connect to a device, you get an event BLE_GAP_EVT_CONNECTED, that sets the m_active_conn_handle equal to the gap event connection handle. If you are not in a connection, m_active_conn_handle is equal to BLE_ERROR_INVALID_CONN_HANDLE, and you get the error BLE_ERROR_INVALID_CONN_HANDLE when using rbc_mesh_value_set().

Reply
  • You need to be in a valid connection when using rbc_mesh_value_set().

    When you connect to a device, you get an event BLE_GAP_EVT_CONNECTED, that sets the m_active_conn_handle equal to the gap event connection handle. If you are not in a connection, m_active_conn_handle is equal to BLE_ERROR_INVALID_CONN_HANDLE, and you get the error BLE_ERROR_INVALID_CONN_HANDLE when using rbc_mesh_value_set().

Children
Related