Utilities for use in Mesh applications and examples.
More...
|
#define | ERROR_CHECK(__error_code) |
|
#define | RETURN_ON_ERROR(status) |
|
|
void | app_error_handler (uint32_t error_code, uint32_t line_number, const uint8_t *filename) |
|
uint32_t | mesh_app_uuid_gen (uint8_t *p_uuid_dest, const uint8_t *p_uuid_prefix, uint8_t uuid_prefix_len) |
| Generates a 16-byte number using FICR DEVICEID-0 Register and the given prefix bytes. More...
|
|
Utilities for use in Mesh applications and examples.
◆ ERROR_CHECK
#define ERROR_CHECK |
( |
|
__error_code | ) |
|
Value:do \
{ \
const uint32_t __local_code = (__error_code); \
if (__local_code != NRF_SUCCESS) \
{ \
app_error_handler(__local_code, __LINE__, (const uint8_t *) __FILE__); \
} \
} while (0)
Definition at line 58 of file mesh_app_utils.h.
◆ RETURN_ON_ERROR
#define RETURN_ON_ERROR |
( |
|
status | ) |
|
Value:do { \
uint32_t result = status; \
if (result != NRF_SUCCESS) \
{ \
return result; \
} \
} while (0);
Definition at line 68 of file mesh_app_utils.h.
◆ mesh_app_uuid_gen()
uint32_t mesh_app_uuid_gen |
( |
uint8_t * |
p_uuid_dest, |
|
|
const uint8_t * |
p_uuid_prefix, |
|
|
uint8_t |
uuid_prefix_len |
|
) |
| |
Generates a 16-byte number using FICR DEVICEID-0 Register and the given prefix bytes.
- Warning
- This function only generates a 16-byte number for demonstration purposes. The UUID for the end product must be generated according to the format specified in RFC4122.
- Parameters
-
[out] | p_uuid_dest | Pointer to the buffer storing the 16-byte number. This buffer must have byte length of NRF_MESH_UUID_SIZE. |
[in] | p_uuid_prefix | Array of bytes to be used as prefix for the 16-byte number. |
[in] | uuid_prefix_len | Length of the array pointed by p_uuid_prefix . Maximum value of this parameter can be NRF_MESH_UUID_SIZE/2. If value of this parameter is less than NRF_MESH_UUID_SIZE/2, the remaining bytes will be filled with zeros. |
- Return values
-
NRF_SUCCESS | The 16-byte number is generated successfully. |
NRF_ERROR_INVALID_LENGTH | The supplied uuid_prefix_len is greater than NRF_MESH_UUID_SIZE/2. |