nRF5 SDK for Mesh v1.0.1
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...
 

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 52 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.

Documentation feedback | Developer Zone | Subscribe | Updated