Utilities for use in Mesh applications and examples.
More...
|
#define | ERROR_CHECK(__error_code) |
|
#define | RETURN_ON_ERROR(status) |
|
|
typedef void(* | execution_start_cb_t) (void) |
|
|
void | app_error_handler (uint32_t error_code, uint32_t line_number, const uint8_t *filename) |
|
static void | execution_start (execution_start_cb_t execution_start_callback) |
| Run function for starting dynamic behavior. More...
|
|
uint32_t | mesh_app_uuid_gen (uint8_t *p_uuid_dest, const uint8_t *p_uuid_prefix, uint8_t uuid_prefix_len) |
| Generates a UUID using DEVICE ID and 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.
◆ execution_start()
static void execution_start |
( |
execution_start_cb_t |
execution_start_callback | ) |
|
|
inlinestatic |
Run function for starting dynamic behavior.
Unless the application event handling is running in thread mode, there is a risk of race conditions if events are processed while running the start function in thread mode. This function will prevent this by disabling all application level interrupts while running the start function.
- Parameters
-
[in] | execution_start_callback | Function for starting dynamic bahavior. |
Definition at line 115 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 UUID using DEVICE ID and given prefix bytes.
- Note
- : This function merely generates a 128 bit unique number for a purpose of demonstration. The UUID for the end product should be generated as per the format specified in ITU-T Rec. X.667.
- Parameters
-
[out] | p_uuid_dest | Pointer to buffer storing the UUID. This buffer must be NRF_MESH_UUID_SIZE bytes long. |
[in] | p_uuid_prefix | Array of bytes that will be used as first of the UUID. |
[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), remaining bytes will be filled with zeros. |
- Return values
-
NRF_SUCCESS | UUID is generated successfully. |
NRF_ERROR_INVALID_LENGTH | Supplied uuid_prefix_len is greater than NRF_MESH_UUID_SIZE/2. |