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?

Parents Reply Children
  • Apparently, bt_id can only be set during adv_create and cannot be changed with update_param.

    I would like to use bt_id_reset() instead.
    However, if the id is associated with adv_create(), calling bt_id_reset() will return an error (-120).
    What are the limitations of bt_id_reset()?

  • loquat said:
    Apparently, bt_id can only be set during adv_create and cannot be changed with update_param.

    So it's the same as old nRF5 SDK then.

    loquat said:
    What are the limitations of bt_id_reset()?

    /**
     * @brief Reset/reclaim an identity for reuse.
     *
     * The semantics of the @a addr and @a irk parameters of this function
     * are the same as with bt_id_create(). The difference is the first
     * @a id parameter that needs to be an existing identity (if it doesn't
     * exist this function will return an error). When given an existing
     * identity this function will disconnect any connections created using it,
     * remove any pairing keys or other data associated with it, and then create
     * a new identity in the same slot, based on the @a addr and @a irk
     * parameters.
     *
     * @note the default identity (BT_ID_DEFAULT) cannot be reset, i.e. this
     * API will return an error if asked to do that.
     *
     * @param id   Existing identity identifier.
     * @param addr Address to use for the new identity. If NULL or initialized
     *             to BT_ADDR_LE_ANY the stack will generate a new static
     *             random address for the identity and copy it to the given
     *             parameter upon return from this function (in case the
     *             parameter was non-NULL).
     * @param irk  Identity Resolving Key (16 bytes) to be used with this
     *             identity. If set to all zeroes or NULL, the stack will
     *             generate a random IRK for the identity and copy it back
     *             to the parameter upon return from this function (in case
     *             the parameter was non-NULL). If privacy
     *             @kconfig{CONFIG_BT_PRIVACY} is not enabled this parameter must
     *             be NULL.
     *
     * @return Identity identifier (>= 0) in case of success, or a negative
     *         error code on failure.
     */
    int bt_id_reset(uint8_t id, bt_addr_le_t *addr, uint8_t *irk);

    From errno.h I can find that the new identity (addr) you are trying to create is the same as the old.
    Best regards,
    Kenneth
  • Is it possible to set a different addr for bt_id_reset?
    Is it possible during advertising?

  • loquat said:
    Is it possible during advertising?

    No.

    Kenneth

Related