nRF5 SDK for Thread and Zigbee v1.0.0
Modules | Macros | Functions
Debug capabilities

Modules

 Debug trace
 
 Mac traffic dump
 

Macros

#define ZB_ASSERT(expr)   {if(!(expr)) zb_assert(__FILE__, __LINE__);}
 
#define ZB_INLINE_ASSERT_SIMPLE(expr)   ((expr) ? 1 : (zb_assert(__FILE__, __LINE__), 1))
 
#define ZB_INLINE_ASSERT(expr)   ZB_INLINE_ASSERT_SIMPLE((expr)),
 
#define ZB_ASSERT_CAT_(a, b)   a##b
 
#define ZB_ASSERT_CAT(a, b)   ZB_ASSERT_CAT_(a, b)
 
#define ZB_ASSERT_COMPILE_TIME(expr)   ((void)(zb_int_t (*)[(expr) ? 1 : -1])0)
 
#define ZB_ASSERT_COMPILE_TIME_EXPR(expr)   ((zb_int_t)((zb_int_t (*)[(expr) ? 1 : -1])0))
 
#define ZB_ASSERT_COMPILE_DECL(expr)   typedef zb_int_t ZB_ASSERT_CAT(assert, __LINE__)[(expr) ? 1 : -1]
 
#define ZB_ASSERT_TYPE_SIZE_NOT_GREATER(type, limit)   ZB_ASSERT_COMPILE_DECL(sizeof(type) <= (limit))
 
#define ZB_ASSERT_TYPE_SIZE_NOT_LESS(type, limit)   ZB_ASSERT_COMPILE_DECL(sizeof(type) >= (limit))
 
#define ZB_ASSERT_TYPE_SIZE_EQ(type, limit)   ZB_ASSERT_COMPILE_DECL(sizeof(type) == (limit))
 
#define ZB_CHK_ARR(arr, len)
 
#define ZB_P3_ON()
 
#define ZB_P3_OFF()
 
#define ZB_P4_ON()
 
#define ZB_P4_OFF()
 
#define DUMP_TRAF(comment, buf, len, total)
 

Functions

void zb_abort (char *caller_file, int caller_line)
 
zb_void_t zb_assert (zb_char_t *file_name, zb_int_t line_number)
 
zb_void_t lwip_zb_assert (zb_uint16_t file_id, zb_int_t line_number)
 
void dump_traf (zb_uint8_t *buf, zb_ushort_t len)
 
void dump_usb_traf (zb_uint8_t *buf, zb_ushort_t len)
 

Detailed Description

Macro Definition Documentation

#define ZB_ASSERT_CAT_ (   a,
 
)    a##b
Compile-time asserts
#define ZB_ASSERT_COMPILE_DECL (   expr)    typedef zb_int_t ZB_ASSERT_CAT(assert, __LINE__)[(expr) ? 1 : -1]

Check condition at compile time in the declaration block

Parameters
expr- expression to check.
#define ZB_ASSERT_COMPILE_TIME (   expr)    ((void)(zb_int_t (*)[(expr) ? 1 : -1])0)

Check condition at compile time in the code (not declaration block)

Parameters
expr- expression to check.
#define ZB_ASSERT_COMPILE_TIME_EXPR (   expr)    ((zb_int_t)((zb_int_t (*)[(expr) ? 1 : -1])0))

Check condition at compile time in the code (not declaration block), return 0 To be used inside expressions.

Parameters
expr- expression to check.
#define ZB_ASSERT_TYPE_SIZE_EQ (   type,
  limit 
)    ZB_ASSERT_COMPILE_DECL(sizeof(type) == (limit))

Ensures, that size of type `type' is equal to the `limit'. If it is not, compilation is aborted.

Parameters
type- type name
limit- size limit
#define ZB_ASSERT_TYPE_SIZE_NOT_GREATER (   type,
  limit 
)    ZB_ASSERT_COMPILE_DECL(sizeof(type) <= (limit))

Ensures, that size of type `type' is not greater than `limit'. If it is not, compilation is aborted.

Parameters
type- type name
limit- size limit
#define ZB_ASSERT_TYPE_SIZE_NOT_LESS (   type,
  limit 
)    ZB_ASSERT_COMPILE_DECL(sizeof(type) >= (limit))

Ensures, that size of type `type' is not less than `limit'. If it is not, compilation is aborted.

Parameters
type- type name
limit- size limit
#define ZB_INLINE_ASSERT (   expr)    ZB_INLINE_ASSERT_SIMPLE((expr)),

Assert which can be used inside expression.

Parameters
expr- expression to check.
Returns
always 1 (true)

Function Documentation

void dump_traf ( zb_uint8_t buf,
zb_ushort_t  len 
)

Dump array of byte

Parameters
buf- array of byte
len- size of array
void zb_abort ( char *  caller_file,
int  caller_line 
)

Trace current location, abort current program execution, with core dump if possible.

Parameters
caller_file- source file name
caller_line- line in the source
zb_void_t zb_assert ( zb_char_t file_name,
zb_int_t  line_number 
)

Assert: print diagnostic and force core dump

Parameters
file_name- source file name
line_number- line in the source

Documentation feedback | Developer Zone | Subscribe | Updated