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

nRF Mesh

typedef struct __attribute((packed))
{
uint8_t on_off; /**< State to set */
uint8_t tid; /**< Transaction number for application */
uint8_t transition_time; /**< Encoded transition time value */
uint8_t delay; /**< Encoded message execution delay in 5 millisecond steps */
} generic_onoff_set_msg_pkt_t;

1. Can you please explain what is the use of transition_time and delay members from the above structure?

2. access_model_add_params_t structure has a member publish_timeout_cb of type access_publish_timeout_cb_t, Can you explain what is the purpose of this callback function? Where the timeout interval is defined?

3. I want to program a node as a relay node which acts as intermediary node to expand the network coverage for server-client model. Can you guide me on this? 

  • Hi,

    1. Transition time and delay: Those are as defined in the Mesh Networking Specifications. Simply put, the state will be set after delay, and the state will "fade" from the current value to the new value over the transition time. With "delay" it is for instance possible to send several messages that all tell the receiving node to switch state at the same time, so that if any one of the messages goes through the node will change state at that time. Useful for instance if you have multiple light bulbs in a large hall, and want all of them to turn on or off at the same time.

    2. The publish_timeout_cb member is a callback function that will get called every time the model is to do a periodic publication. Periodic publication is a feature where the model is configured to publish at a set interval. For reference on how this is used in code, see the documentation for the Simple OnOff model, which serves as a walk-through of how to implement a custom model.

    3. The relay feature is core part of the stack, and is enabled in the default project configuration. In an nRF5 SDK for Mesh project, you enable it by defining MESH_FEATURE_RELAY_ENABLED as 1. This is in the default configuration file nrf_mesh_config_core.h. Defines from that file can be overridden in e.g. nrf_mesh_config_app.h. In Bluetooth mesh, packets automatically gets resent by relay nodes, so provisioning relay nodes into your network is basically all that is needed for packets to be sent through intermediary nodes when needed. There is one more thing to think about, and that is that each packet is sent with a time to live (TTL), which defines the maximum number of "hops" that the packet can take through the network. You can define a default TTL compile time, and in a live mesh network you can configure the TTL for each element's publications.

    Regards,
    Terje

Related