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

How works the access_model_publish_address_get()?

Dear community,

I would like to retrieve all publish address using this command :

ERROR_CHECK(access_model_publish_address_get(m_dev_handles.m_generic_client_instance[0].model_handle, &address_handle));

__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Publish addresses: 0x%04x \n", address_handle);

Then address_handle is returning 0x0000... but my I can communicate with the LPN and send onoff message to switch light. The LPN has subscribe address 0xC404 and the friend has publish address which is same address than subscribe address of LPN as logical. To do this I used :

access_model_publish_address_set(m_dev_handles.m_generic_client_instance[0].model_handle, m_dev_handles.m_server_handles[0]);

and before that in case it helps, I do:

dsm_address_publish_add(p_evt->params.complete.p_prov_data->address, &m_dev_handles.m_server_handles[0]));

This code is inspired from light switch example in nrf5_SDK_for_Mesh_v1.0.1.

What am I doing wrong ?

  • Hi,

    The return value for the address handle is the handle used by DSM for storing the address. So it is not the address itself, but rather an index into the table of known addresses. Use dsm_address_get() to retrieve the address from that handle.

    Also, nRF5 SDK for Mesh v1.0.1 is getting old, there has been a lot of added features and several bugfixes since then. I strongly recommend upgrading to version 5.0.0 which is currently the newest version.

    Regards,
    Terje

Related