Value MAX ble_adv_fast_timeout in advertising configuration

Hi,

I am develloping advertising configuration and would like to use the fast or slow advertising mode.

In the ble_advertising.h, it seems that the limit are an uint32_t

 

typedef struct
{
    bool     ble_adv_on_disconnect_disabled;     /**< Enable or disable automatic return to advertising upon disconnecting.*/
    bool     ble_adv_whitelist_enabled;          /**< Enable or disable use of the whitelist. */
    bool     ble_adv_directed_high_duty_enabled; /**< Enable or disable high duty direct advertising mode. Can not be used together with extended advertising. */
    bool     ble_adv_directed_enabled;           /**< Enable or disable direct advertising mode. */
    bool     ble_adv_fast_enabled;               /**< Enable or disable fast advertising mode. */
    bool     ble_adv_slow_enabled;               /**< Enable or disable slow advertising mode. */
    uint32_t ble_adv_directed_interval;          /**< Advertising interval for directed advertising. */
    uint32_t ble_adv_directed_timeout;           /**< Time-out (number of tries) for direct advertising. */
    uint32_t ble_adv_fast_interval;              /**< Advertising interval for fast advertising. */
    uint32_t ble_adv_fast_timeout;               /**< Time-out (in units of 10ms) for fast advertising. */
    uint32_t ble_adv_slow_interval;              /**< Advertising interval for slow advertising. */
    uint32_t ble_adv_slow_timeout;               /**< Time-out (in units of 10ms) for slow advertising. */
    bool     ble_adv_extended_enabled;           /**< Enable or disable extended advertising. */
    uint32_t ble_adv_secondary_phy;              /**< PHY for the secondary (extended) advertising @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED). */
    uint32_t ble_adv_primary_phy;                /**< PHY for the primary advertising. @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED). */
} ble_adv_modes_config_t;

But after testing, it seems that the limit are uint16_t. (i would like a timeout after 20 minutes).

The SDK used are 15.3 and softdevice s132_nrf52_6.1.0_softdevice on NRF52832.

Thanks and best Regards,

Julien

Parents
  • Hi,

    I can confirm that this should have been a uint16_t. The value gets used for the duration field of the ble_gap_adv_params_t structure in the SoftDevice API, and there it is uint16_t. In order to advertise in one advertising mode for longer than 10 minutes, you must control this from the application, for instance by stopping and starting advertising in the given advertising mode N number of times before letting the advertising module move on to the next state. This could get complicated, so often the best workaround would be to accept the maximum duration of slightly less than 11 minutes.

    Regards,
    Terje

Reply
  • Hi,

    I can confirm that this should have been a uint16_t. The value gets used for the duration field of the ble_gap_adv_params_t structure in the SoftDevice API, and there it is uint16_t. In order to advertise in one advertising mode for longer than 10 minutes, you must control this from the application, for instance by stopping and starting advertising in the given advertising mode N number of times before letting the advertising module move on to the next state. This could get complicated, so often the best workaround would be to accept the maximum duration of slightly less than 11 minutes.

    Regards,
    Terje

Children
Related