NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
Bluetooth Host Identity

Bluetooth Host Identity. More...

Functions

int ble_hs_id_gen_rnd (int nrpa, ble_addr_t *out_addr)
 
int ble_hs_id_set_rnd (const uint8_t *rnd_addr)
 
int ble_hs_id_copy_addr (uint8_t id_addr_type, uint8_t *out_id_addr, int *out_is_nrpa)
 
int ble_hs_id_infer_auto (int privacy, uint8_t *out_addr_type)
 

Detailed Description

Bluetooth Host Identity.

Function Documentation

◆ ble_hs_id_copy_addr()

int ble_hs_id_copy_addr ( uint8_t  id_addr_type,
uint8_t *  out_id_addr,
int *  out_is_nrpa 
)

Retrieves one of the device's identity addresses. The device can have two identity addresses: one public and one random. The id_addr_type argument specifies which of these two addresses to retrieve.

Parameters
id_addr_typeThe type of identity address to retrieve. Valid values are: o BLE_ADDR_PUBLIC o BLE_ADDR_RANDOM
out_id_addrOn success, the requested identity address is copied into this buffer. The buffer must be at least six bytes in size. Pass NULL if you do not require this information.
out_is_nrpaOn success, the pointed-to value indicates whether the retrieved address is a non-resolvable private address. Pass NULL if you do not require this information.
Returns
0 on success; BLE_HS_EINVAL if an invalid address type was specified; BLE_HS_ENOADDR if the device does not have an identity address of the requested type; Other BLE host core code on error.

◆ ble_hs_id_gen_rnd()

int ble_hs_id_gen_rnd ( int  nrpa,
ble_addr_t *  out_addr 
)

Generates a new random address. This function does not configure the device with the new address; the caller can use the address in subsequent operations.

Parameters
nrpaThe type of random address to generate: 0: static 1: non-resolvable private
out_addrOn success, the generated address gets written here.
Returns
0 on success; nonzero on failure.

◆ ble_hs_id_infer_auto()

int ble_hs_id_infer_auto ( int  privacy,
uint8_t *  out_addr_type 
)

Determines the best address type to use for automatic address type resolution. Calculation of the best address type is done as follows:

if privacy requested: if we have a random static address: --> RPA with static random ID else --> RPA with public ID end else if we have a random static address: --> random static address else --> public address end end

Parameters
privacy(0/1) Whether to use a private address.
out_addr_typeOn success, the "own addr type" code gets written here.
Returns
0 if an address type was successfully inferred. BLE_HS_ENOADDR if the device does not have a suitable address. Other BLE host core code on error.

◆ ble_hs_id_set_rnd()

int ble_hs_id_set_rnd ( const uint8_t *  rnd_addr)

Sets the device's random address. The address type (static vs. non-resolvable private) is inferred from the most-significant byte of the address. The address is specified in host byte order (little-endian!).

Parameters
rnd_addrThe random address to set.
Returns
0 on success; BLE_HS_EINVAL if the specified address is not a valid static random or non-resolvable private address. Other nonzero on error.