Function bt_id_reset

Source
pub unsafe extern "C" fn bt_id_reset(
    id: u8,
    addr: *mut bt_addr_le_t,
    irk: *mut u8,
) -> c_int
Expand description

@brief Reset/reclaim an identity address 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 handle (if it doesn’t exist this function will return an error). When given an existing identity handle this function will disconnect any connections (to the corresponding identity address) created using it, remove any pairing keys or other data associated with it, and then create a new identity address in the same slot, based on the @a addr and @a irk parameters.

@note The default identity address (corresponding to BT_ID_DEFAULT) cannot be reset, and this API will return an error if asked to do that.

@param id Existing identity handle. @param addr Address to use for the new identity address. If NULL or initialized to BT_ADDR_LE_ANY the stack will generate a new static random address for the identity address and copy it to the given parameter upon return from this function. @param irk Identity Resolving Key (16 bytes) to be used with this identity address. If set to all zeroes or NULL, the stack will generate a random IRK for the identity address 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 handle (>= 0) in case of success, or a negative error code on failure.