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

mesh unreliable and reliable

Hi Nordic

For mesh-sdk-2.1.1, there are two APIs "simple_on_off_client_set" and "simple_on_off_client_set_unreliable", that can send packet with acknowledge or unacknowledge,

I want to ask how to set the interval time between every repeated-sending of "simple_on_off_client_set_unreliable"?

And for "simple_on_off_client_set", I want to ask how to set acknowledge timeout? and how to set the number of retry?

 

Regards,

Joseph

Parents
  • Hello Joseph,

    Basically, the time between every repeated-sending of "simple_on_off_client_set_unreliable" should be minimum advertising interval (20ms) plus a random time (0 ~ 10ms).

    And for the acknowledge timeout, we can check the "access_reliable.h", line 70:

    #define ACCESS_RELIABLE_TIMEOUT_MIN  (SEC_TO_US(30))

    Please note that in the Bluetooth mesh specification p.96, mentioned that:

    "The acknowledge message timeout should be set to a minimum of 30 seconds. The exact value is application specific."

    For the number of retry, we may not able to set a specific number, but you may have interested to check the code in "access_reliable.c", line 240, which shows how the retry interval be calculated.

    static uint32_t calculate_interval(const access_reliable_t * p_message)
    {
        uint8_t ttl;
        /* The model handle should already been checked by the TX attempt. */
        NRF_MESH_ERROR_CHECK(access_model_publish_ttl_get(p_message->model_handle, &ttl));
    
        uint16_t length = access_utils_opcode_size_get(p_message->message.opcode) + p_message->message.length;
    
        uint32_t interval = (ttl * ACCESS_RELIABLE_HOP_PENALTY) + ACCESS_RELIABLE_INTERVAL_DEFAULT;
        if (NRF_MESH_UNSEG_PAYLOAD_SIZE_MAX < length)
        {
            interval += ((length + (NRF_MESH_SEG_SIZE - 1))/ NRF_MESH_SEG_SIZE) * ACCESS_RELIABLE_SEGMENT_COUNT_PENALTY;
        }
        return interval;
    }

    Hope the upon information can do help Slight smile

  • Hi Rick

    It's helpful to me, thanks for the answer.

    Joseph

Reply Children
No Data
Related