nRF5 SDK for Mesh v5.0.0
Macros | Functions
Utility functions

Utility functions for mesh users. More...

Macros

#define BLE_GAP_ADDR_TYPE_RANDOM_INVALID   0x04
 Invalid Random address type. More...
 

Functions

uint32_t nrf_mesh_rand_get (uint8_t *p_output, uint8_t size)
 Obtains a random number from the random number generator. More...
 
nrf_mesh_address_type_t nrf_mesh_address_type_get (uint16_t address)
 Get the address type of little endian 16-bit mesh addresses. More...
 
uint8_t nrf_mesh_gap_address_type_get (const uint8_t *p_address, uint8_t txadd_bit)
 Get the GAP address type of a given device address. More...
 
static const nrf_mesh_beacon_secmat_tnrf_mesh_beacon_secmat_from_info (const nrf_mesh_beacon_info_t *p_beacon_info, nrf_mesh_key_refresh_phase_t kr_phase)
 Get the beacon secmat representing the given key refresh phase from the beacon info. More...
 

Detailed Description

Utility functions for mesh users.

Macro Definition Documentation

◆ BLE_GAP_ADDR_TYPE_RANDOM_INVALID

#define BLE_GAP_ADDR_TYPE_RANDOM_INVALID   0x04

Invalid Random address type.

Definition at line 53 of file nrf_mesh_utils.h.

Function Documentation

◆ nrf_mesh_rand_get()

uint32_t nrf_mesh_rand_get ( uint8_t *  p_output,
uint8_t  size 
)

Obtains a random number from the random number generator.

Parameters
[out]p_outputPointer to a buffer where the output is written.
[in]sizeSize of the output buffer.
Return values
NRF_SUCCESSThe specified buffer was filled with the requested amount of random data.
NRF_ERROR_NULLThe parameter p_output is a NULL pointer.

◆ nrf_mesh_address_type_get()

nrf_mesh_address_type_t nrf_mesh_address_type_get ( uint16_t  address)

Get the address type of little endian 16-bit mesh addresses.

Parameters
[in]addressLittle endian 16bit mesh address to get the type of.
Returns
Address type of the given address.

◆ nrf_mesh_gap_address_type_get()

uint8_t nrf_mesh_gap_address_type_get ( const uint8_t *  p_address,
uint8_t  txadd_bit 
)

Get the GAP address type of a given device address.

Parameters
[in]p_addressPointer to the 6 byte address array.
[in]txadd_bitThe value of the TxAdd bit in the advertisement packet pdu header.
Returns
One of see BLE_GAP_ADDR_TYPES in ble_gap.h, if the given address has a valid type, otherwise BLE_GAP_ADDR_TYPE_RANDOM_INVALID.

◆ nrf_mesh_beacon_secmat_from_info()

static const nrf_mesh_beacon_secmat_t* nrf_mesh_beacon_secmat_from_info ( const nrf_mesh_beacon_info_t p_beacon_info,
nrf_mesh_key_refresh_phase_t  kr_phase 
)
inlinestatic

Get the beacon secmat representing the given key refresh phase from the beacon info.

Parameters
[in]p_beacon_infoBeacon info the get secmat from.
[in]kr_phaseCurrent key refresh phase.
Returns
A pointer to the secmat used during the given key refresh phase.

Definition at line 94 of file nrf_mesh_utils.h.

References NRF_MESH_KEY_REFRESH_PHASE_0, nrf_mesh_beacon_info_t::secmat, and nrf_mesh_beacon_info_t::secmat_updated.


Documentation feedback | Developer Zone | Subscribe | Updated