Cordio Stack and Cordio Profiles  r2p3-02rel0
WSF Assert API

Macros

#define WSF_ASSERT_ENABLED   FALSE
 Enable assertion statements.
 
#define WSF_ASSERT(expr)    if (!(expr)) {WsfAssert(MODULE_ID, (uint16_t) __LINE__);}
 Run-time assert macro. The assert executes when the expression is FALSE. More...
 
#define WSF_CT_ASSERT(expr)    extern char wsf_ct_assert[(expr) ? 1 : -1]
 Compile-time assert macro. This macro causes a compiler error when the expression is FALSE. Note that this macro is generally used at file scope to test constant expressions. Errors may result of it is used in executing code. More...
 

Functions

void WsfAssert (uint16_t modId, uint16_t line)
 Perform an assert action. More...
 
uint16_t WsfAssertNum (void)
 Get number of asserts. More...
 
void WsfAssertTrapEnable (bool_t enaAssertTrap)
 Enable assert trap. More...
 
void WsfAssertRegister (void(*cback)(void))
 Register assert handler. More...
 

Description

Macro Definition Documentation

#define WSF_ASSERT (   expr)    if (!(expr)) {WsfAssert(MODULE_ID, (uint16_t) __LINE__);}

Run-time assert macro. The assert executes when the expression is FALSE.

Parameters
exprBoolean expression to be tested.
Returns
None

Definition at line 96 of file wsf_assert.h.

#define WSF_CT_ASSERT (   expr)    extern char wsf_ct_assert[(expr) ? 1 : -1]

Compile-time assert macro. This macro causes a compiler error when the expression is FALSE. Note that this macro is generally used at file scope to test constant expressions. Errors may result of it is used in executing code.

Parameters
exprBoolean expression to be tested.
Returns
None

Definition at line 115 of file wsf_assert.h.

Function Documentation

void WsfAssert ( uint16_t  modId,
uint16_t  line 
)

Perform an assert action.

Parameters
modIdName of file originating assert.
lineLine number of assert statement.
Returns
None.
uint16_t WsfAssertNum ( void  )

Get number of asserts.

Returns
Number of asserts.
void WsfAssertTrapEnable ( bool_t  enaAssertTrap)

Enable assert trap.

Parameters
enaAssertTrapTRUE to enable assert trap.
Returns
None.
void WsfAssertRegister ( void(*)(void)  cback)

Register assert handler.

Parameters
cbackCallback called upon assert condition.
Returns
None