Macros for parameter checking and similar tasks.
More...
Macros for parameter checking and similar tasks.
#define VERIFY_FALSE |
( |
|
statement, |
|
|
|
err_code |
|
) |
| |
Value:do \
{ \
if ((statement)) \
{ \
return err_code; \
} \
} while (0)
Macro for verifying statement to be false. It will cause the exterior function to return err_code if the statement is not false.
- Parameters
-
[in] | statement | Statement to test. |
[in] | err_code | Error value to return if test was invalid. |
- Return values
-
nothing,but | will cause the exterior function to return err_code if statement is true. |
#define VERIFY_FALSE_VOID |
( |
|
statement | ) |
VERIFY_FALSE((statement), ) |
Macro for verifying statement to be false. It will cause the exterior function to return if the statement is not false.
- Parameters
-
[in] | statement | Statement to test. |
Macro for verifying that the module is initialized. It will cause the exterior function to return NRF_ERROR_INVALID_STATE if not.
- Note
- MODULE_INITIALIZED must be defined in each module using this macro. MODULE_INITIALIZED should be true if the module is initialized, false if not.
#define VERIFY_MODULE_INITIALIZED_VOID |
( |
| ) |
VERIFY_TRUE_VOID((MODULE_INITIALIZED)) |
Macro for verifying that the module is initialized. It will cause the exterior function to return if not.
- Note
- MODULE_INITIALIZED must be defined in each module using this macro. MODULE_INITIALIZED should be true if the module is initialized, false if not.
Macro for verifying that the module is initialized. It will cause the exterior function to return if not.
- Parameters
-
[in] | param | The variable to check if is NULL. |
Macro for verifying that the module is initialized. It will cause the exterior function to return if not.
- Parameters
-
[in] | param | The variable to check if is NULL. |
Macro for verifying that a function returned NRF_SUCCESS. It will cause the exterior function to return err_code if the err_code is not NRF_SUCCESS.
- Parameters
-
[in] | err_code | The error code to check. |
Macro for verifying that a function returned NRF_SUCCESS. It will cause the exterior function to return if the err_code is not NRF_SUCCESS.
- Parameters
-
[in] | err_code | The error code to check. |
#define VERIFY_TRUE |
( |
|
statement, |
|
|
|
err_code |
|
) |
| |
Value:do \
{ \
if (!(statement)) \
{ \
return err_code; \
} \
} while (0)
Macro for verifying statement to be true. It will cause the exterior function to return err_code if the statement is not true.
- Parameters
-
[in] | statement | Statement to test. |
[in] | err_code | Error value to return if test was invalid. |
- Return values
-
nothing,but | will cause the exterior function to return err_code if statement is false. |
#define VERIFY_TRUE_VOID |
( |
|
statement | ) |
VERIFY_TRUE((statement), ) |
Macro for verifying statement to be true. It will cause the exterior function to return if the statement is not true.
- Parameters
-
[in] | statement | Statement to test. |