Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bonding and directed advertising

Hello,

I have an application where a BLE central connects to a BLE peripheral. Then the devices do the bonding procedure. After the devices are bonded the peripheral should only do directed advertising to that one central.

So far I can get the devices to bond but after they disconnect and the peripheral should start directed advertising my program fails at the sd_ble_gap_adv_set_configure call with an NRF_ERROR_INVALID_PARAM error. The parameters include a random static address as peer address and PHY coded. Whitelist is not used.

What could be the problem there?

  • nRF5 SDK 17.0.2
  • Softdevice 7.2.0

Thanks in advance!

Parents
  • Can you show me a code snippet of how you initialize advertising when you try to do directed advertising? I'm guessing you're trying to add something to your advertising that is not supported by Coded PHY advertising.

    Best regards,

    Simon

  • Hi,

    This is how I initialize advertising:

    ble_advertising_init_t init;
    init.config.ble_adv_directed_enabled       = true;
    init.config.ble_adv_directed_interval      = 0;
    init.config.ble_adv_directed_timeout       = 0;
    init.config.ble_adv_fast_enabled           = true;
    init.config.ble_adv_fast_interval          = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout           = APP_ADV_DURATION;
    init.config.ble_adv_on_disconnect_disabled = true;
    init.config.ble_adv_extended_enabled       = true;
    init.config.ble_adv_primary_phy            = BLE_GAP_PHY_CODED;
    init.config.ble_adv_secondary_phy          = BLE_GAP_PHY_CODED;

Reply
  • Hi,

    This is how I initialize advertising:

    ble_advertising_init_t init;
    init.config.ble_adv_directed_enabled       = true;
    init.config.ble_adv_directed_interval      = 0;
    init.config.ble_adv_directed_timeout       = 0;
    init.config.ble_adv_fast_enabled           = true;
    init.config.ble_adv_fast_interval          = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout           = APP_ADV_DURATION;
    init.config.ble_adv_on_disconnect_disabled = true;
    init.config.ble_adv_extended_enabled       = true;
    init.config.ble_adv_primary_phy            = BLE_GAP_PHY_CODED;
    init.config.ble_adv_secondary_phy          = BLE_GAP_PHY_CODED;

Children
Related