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

Is advertising timeout max value 65535 on SDK 15?

Hi.

I am using nRF52840 & SDK 15.0.0.

I set the advertising slow timeout to 14 min,
But, the advertising stops at about 3 min.

The followings is summary of advertising settings.

> ble_advertising_init_t init;
> init.config.ble_adv_slow_timeout = 84000;
> ret = ble_advertising_init(&m_advertising, &init);
> APP_ERROR_CHECK(ret);

I checked SDK codes.

init.config.ble_adv_slow_timeout is uint32_t.
init.config.ble_adv_slow_timeout is copied to p_adv_params->duration at set_adv_mode_slow(...).
ble_gap_adv_params_t    * p_adv_params ->duration is uint16_t.

So, Is advertising timeout max value 65535 on SDK 15?

How to set advertising timeout to 14min?

Thanks,

Parents
  • Hello,

    You seem to be right. The p_adv_params->duration is a uint16_t. I believe that this is a bug, but let me report it to the our SDK team, and see if there is a reason for why it is done like this.

    I will keep you updated when I hear something.

    In the meantime, I don't see any problems with changing p_adv_params->duration to be a uint32_t variable instead of uint16_t. The project compiles, and the device advertises, so you can assume that this will work, and as I said, I will keep you updated when I hear something from the SDK team.

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you for answer,

    p_adv_params->duration(uint16_t) is set by set_adv_mode_slow().
    set_adv_mode_slow() is called from ble_advertising_start().
    The SDK set slow duration value to 
    p_advertising->adv_params by set_adv_mode_slow().
    Finally, p_advertising->adv_params (struct) is set Softdevice directly by sd_ble_gap_adv_set_configure().

    So, you mean that the fixing needs to modified both the SDK and the Softdevice. 
    Is this correct?

    Thanks,
     

Reply
  • Hi Edvin,

    Thank you for answer,

    p_adv_params->duration(uint16_t) is set by set_adv_mode_slow().
    set_adv_mode_slow() is called from ble_advertising_start().
    The SDK set slow duration value to 
    p_advertising->adv_params by set_adv_mode_slow().
    Finally, p_advertising->adv_params (struct) is set Softdevice directly by sd_ble_gap_adv_set_configure().

    So, you mean that the fixing needs to modified both the SDK and the Softdevice. 
    Is this correct?

    Thanks,
     

Children
Related