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

Timeout for directed slow advertising

In the BLE advertising library, in SDK 11, is the timeout for directed slow advertising specified in seconds, or in number of tries?

Seconds would be more consistent with the timeouts on the other modes (directed fast, fast, slow). But the field on the struct specifically says "number of tries" in the comment:

typedef struct
{
    ...
    uint32_t ble_adv_directed_slow_timeout;   /**< Time-out (number of tries) for direct advertising. */
    ...
} ble_adv_modes_config_t;

If it really is number of tries, then how many seconds is does each "try" last for?

  • Hi

    Maybe I am misunderstanding your question, but isn't that given by the line above?

    typedef struct
    {
        ...
        uint32_t ble_adv_directed_slow_interval;  /**< Advertising interval for directed advertising. */
        uint32_t ble_adv_directed_slow_timeout;   /**< Time-out (number of tries) for direct advertising. */
        ...
    } ble_adv_modes_config_t;
    

    If you have a slow advertising interval of e.g. 100ms and a timeout of 10 tries your device will be advertising for

    10 tries * 100 ms/try = 1 second
    
  • Based on my testing, it looks like the comment in ble_advertising.h is wrong. ble_adv_directed_slow_timeout is in seconds, NOT number of tries (unless each "try" is 1s, regardless of the interval). The comment is still there in SDK 13.0.0-1.alpha.

Related