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

BLE Mesh SDK - Publish to unicast address

Hi,

how can I publish a message to unicast address from a generic on/off client with mesh sdk?

How can I set the address?

Jost to be more precise, the function:

      access_model_reliable_publish(const access_reliable_t * p_reliable)

only works if the client model publishes on a unicast address:

    if (pub_addr.type == NRF_MESH_ADDRESS_TYPE_UNICAST)
    {
        add_reliable_message(index, p_reliable);
    }

    return NRF_SUCCESS;

What if the model publishes on group address?

We need to implement a gateway. How can we address singles nodes in the mesh net?

Thank you

Lucio

  • Hung,

    I think we need a generic_server because the gateway has all the functions of a standard node plus the wifi connectivity to act as a bribge to internet. Do you agree about that or I should only use a generic_client? I'm not sure. 

    I'm looking to config_server.c - handle_config_model_publication_set() function.

    Here they call dsm_address_publish_remove() before calling dsm_address_publish_add() if publish_address_stored is different from publish_address.

    This way you always have one element on the table.

    In the above link you suggest to add all addresses before then switch between them. Which is the preferred way?

    Do I need to call access_flash_config_store() at the end of this process every time I change the publishing address? This can lead to a rapid deterioration of the flash memory?

    Thank you

  • Hi Lucio, 

    Yes, you can have a the server on the gateway, if that node also act as a normal node. The client on the gateway can send packet to the server on the same node (but we will not broadcast the packet but route it internally ) 

    It's up to you to decide if you want to delete the address in DSM database. You don't have to follow what we have in the config_server.c . There is only one rule ab that, you can have only one publish address at a time. 

    I don't think you should call access_flash_config_store() this everytime if you switch server address all the time. There is some good read about flash usage in mesh here.

Related