bt_le_ext_adv_update_param() cannot change BDADDR

I am using the nrf connect SDK.

I want to switch multiple BDADDRs in one AdvertiseSet.
BDADDR does not change even if bt_le_adv_param.id is changed in bt_le_ext_adv_update_param().

Is there any way?

  • loquat said:
    Is it possible during advertising?

    No.

    Kenneth

  • Core spec v5.1
    LE Set Advertising Set Random Address command

     want to do the same thing.
    It seems that this command can be called even during Advertising.
    (It seems that the setting will be reflected at the next enable.)

    what should i do?

    ---------------------------------------------------------------------------------------------
    I checked the source code.

    zephyr/subsys/bluetooth/host/adv.c
    int bt_le_ext_adv_update_param()
      ...
      le_ext_adv_param_set()
        ...
        ////////////////////////////////////
        It looks like are setting BDADDR
        ////////////////////////////////////
        err = bt_id_set_adv_own_addr(adv, param->options, dir_adv,
                         &cp->own_addr_type);
          ...
          /* Set which local identity address we're advertising with */
          ///////////////////////////////////////////////
           BDADDR is not new addr but old(current) addr?
          ///////////////////////////////////////////////
          id_addr = &bt_dev.id_addr[adv->id];
          ...
          if (options & BT_LE_ADV_OPT_USE_IDENTITY) {
            if (id_addr->type == BT_ADDR_LE_RANDOM) {
              err = bt_id_set_adv_random_addr(adv, &id_addr->a);
            }

    is something wrong?

  • It is not allowed for most types of advertising.

    When using legacy advertising commands the address that is used is the one set through "HCI LE Set Random Address command". In Core_v5.4, Vol 4, Part E, Section 7.8.4:

    If the Host issues this command when any of advertising (created using legacy advertising commands), scanning, or initiating are enabled, the Controller shall return the error code Command Disallowed (0x0C).

    When using extended advertising commands the address that is used is the one set through "LE Set Advertising Set Random Address command". In Core_v5.4, Vol 4, Part E, Section 7.8.52:

    However, if the Host issues this command while the advertising set identified by the Advertising_Handle parameter is using connectable advertising and is enabled, the Controller shall return the error code Command Disallowed (0x0C).

    Best regards,
    Kenneth

  • No, that's not what I want to know.

    Did you forget to set param->id to adv->id in the process of bt_le_ext_adv_update_param()?

Related