
Data Structures | |
| struct | zb_trace_handler_info_s |
Macros | |
| #define | ZB_SET_TRACE_LEVEL(l) zb_trace_set_level(l) |
| #define | ZB_SET_TRACE_OFF() zb_trace_set_off() |
| #define | ZB_SET_TRACE_ON() zb_trace_set_on() |
| #define | ZB_SET_TRACE_MASK(m) zb_trace_set_mask(m) |
| #define | TRACE_SUBSYSTEM_APP 0x0800U |
| #define | TRACE_SUBSYSTEM_ZGP 0x4000U |
| #define | TRACE_SUBSYSTEM_INFO (~0U) |
| #define | TRACE_ENABLED(m) TRACE_ENABLED_(m) |
| Check that trace is enabled for provided level. To be used in constructions like: More... | |
| #define | ZB_TRACE_FILE_ID 12345U |
| #define | TRACE_INIT(name) (void)zb_trace_init(name) |
| #define | TRACE_DEINIT() zb_trace_deinit() |
| #define | TRACE_DISABLE_DEINIT() zb_trace_disable_deinit() |
| #define | TRACE_IS_DISABLE_DEINIT() zb_trace_is_disable_deinit() |
| #define | TRACE_COMMIT() zb_trace_commit() |
| #define | TRACE_FLUSH() zb_trace_flush() |
| #define | TRACE_ENTER_CS() zb_trace_enter_cs() |
| #define | TRACE_LEAVE_CS() zb_trace_leave_cs() |
| #define | TRACE_INSIDE_CS() zb_trace_inside_cs() |
| #define | TRACE_MSG(lm, fmts, args) |
| Put trace output. More... | |
| #define | TRACE_ENTER_INT TRACE_ENTER_CS |
| #define | TRACE_LEAVE_INT TRACE_LEAVE_CS |
| #define | ZB_SET_TRAF_DUMP_OFF() zb_trace_traffic_dump_disable() |
| #define | ZB_SET_TRAF_DUMP_ON() zb_trace_traffic_dump_enable() |
| #define | ZB_GET_TRAF_DUMP_STATE() zb_trace_traffic_dump_state_get() |
Typedefs | |
| typedef struct zb_trace_handler_info_s | zb_trace_handler_info_t |
| typedef zb_ret_t(* | zb_trace_handler_t) (const zb_trace_handler_info_t *info, const zb_char_t *trace_msg, zb_uint16_t trace_len) |
Functions | |
| void | zb_trace_set_level (zb_uint8_t level) |
| void | zb_trace_set_off (void) |
| void | zb_trace_set_on (void) |
| void | zb_trace_set_mask (zb_uint32_t mask) |
| void | zb_trace_str (const zb_char_t *str) |
| A universal way to print raw string as trace message (usually used to print a string data in case of BINARY mode). More... | |
| void | zb_print2x (zb_uint8_t byte, zb_char_t *buf, zb_uint16_t *pos) |
| Put a hex representation of a byte into a buffer at specified position. More... | |
| zb_bool_t | zb_trace_level_mask_enabled (zb_uint8_t level, zb_uint32_t mask) |
| Check that trace is enabled for provided level and mask. More... | |
| zb_uint32_t | zb_trace_get_counter (void) |
| void | zb_trace_lock (void) |
| void | zb_trace_unlock (void) |
| void | zb_trace_handler_setup (zb_trace_handler_t handler) |
| void | zb_trace_traffic_dump_disable (void) |
| void | zb_trace_traffic_dump_enable (void) |
| zb_uint8_t | zb_trace_traffic_dump_state_get (void) |
| #define TRACE_COMMIT | ( | ) | zb_trace_commit() |
Commit forces the file system to flush its buffers to disk.
| #define TRACE_DEINIT | ( | ) | zb_trace_deinit() |
Deinitialize trace subsystem
| #define TRACE_DISABLE_DEINIT | ( | ) | zb_trace_disable_deinit() |
Prevent Trace subsystem be de-initialized MAY be used when STACK restart logic is used
| #define TRACE_ENTER_CS | ( | ) | zb_trace_enter_cs() |
Enter to critical section
Macro that can be used to prevent trace to be issued in case there some critical section of code. Instead, the trace itself will be generated but put into the special internal ring buffer, the trace issue itself will be delayed and finally issued once next trace message will be generated outside of critical section
| #define TRACE_ENTER_INT TRACE_ENTER_CS |
| #define TRACE_FLUSH | ( | ) | zb_trace_flush() |
Flush forces trace buffered data to be written to the file system or port
| #define TRACE_INIT | ( | name | ) | (void)zb_trace_init(name) |
Initialize trace subsystem
| name | - trace file name component |
| #define TRACE_INSIDE_CS | ( | ) | zb_trace_inside_cs() |
Check that critical section is placed
| #define TRACE_IS_DISABLE_DEINIT | ( | ) | zb_trace_is_disable_deinit() |
Check that trace subsystem deinitialization logic is disabled
| #define TRACE_LEAVE_CS | ( | ) | zb_trace_leave_cs() |
Leave from critical section
| #define TRACE_LEAVE_INT TRACE_LEAVE_CS |
| #define TRACE_MSG | ( | lm, | |
| fmts, | |||
| args | |||
| ) |
Put trace output.
| lm | - trace subsystem and level marker. |
| fmts | - printf()-like format string. |
| args | - format string substitution parameters with a size marker. |
| #define TRACE_SUBSYSTEM_APP 0x0800U |
User Application
| #define TRACE_SUBSYSTEM_INFO (~0U) |
Common subsystem
| #define TRACE_SUBSYSTEM_ZGP 0x4000U |
ZGP subsystem
| #define ZB_SET_TRACE_LEVEL | ( | l | ) | zb_trace_set_level(l) |
Set trace level at runtime
That macro can switch trace level on and off. Trace level must be included into build at compile time by setting ZB_TRACE_LEVEL compiler time define.
| l | - new trace level. |
| #define ZB_SET_TRACE_MASK | ( | m | ) | zb_trace_set_mask(m) |
Set trace mask at runtime
That macro can switch trace mask on and off. Trace mask must be included into build at compile time by setting ZB_TRACE_MASK compiler time define.
| m | - new trace mask. |
| #define ZB_SET_TRACE_OFF | ( | ) | zb_trace_set_off() |
Switch off all trace at runtime
| #define ZB_SET_TRACE_ON | ( | ) | zb_trace_set_on() |
Switch on trace at runtime
That macro enables trace which was active before call to ZB_SET_TRACE_OFF().
| typedef struct zb_trace_handler_info_s zb_trace_handler_info_t |
| typedef zb_ret_t(* zb_trace_handler_t) (const zb_trace_handler_info_t *info, const zb_char_t *trace_msg, zb_uint16_t trace_len) |
Prototype of trace callback that external code may setup
| void zb_print2x | ( | zb_uint8_t | byte, |
| zb_char_t * | buf, | ||
| zb_uint16_t * | pos | ||
| ) |
Put a hex representation of a byte into a buffer at specified position.
| byte | [in] Value to be formatted as 2 hex digits |
| buf | [in] Pointer to char buffer |
| pos | [in,out] Position in buf at which to put the hex data (incremented by 2) |
| zb_uint32_t zb_trace_get_counter | ( | void | ) |
| void zb_trace_handler_setup | ( | zb_trace_handler_t | handler | ) |
Setup trace callback or clear it using NULL as argument value Two possible cases
Note: the setup itself is performed under zb_trace_lock()/zb_trace_unlock() block
| void zb_trace_lock | ( | void | ) |
Lock the trace object. Completely platform depended function
It could be used in cases implementation is used trace object, for example, by using, zb_trace_file_object_get() in multitheraded applications.
| void zb_trace_set_level | ( | zb_uint8_t | level | ) |
| void zb_trace_set_mask | ( | zb_uint32_t | mask | ) |
| void zb_trace_set_off | ( | void | ) |
| void zb_trace_set_on | ( | void | ) |
| void zb_trace_str | ( | const zb_char_t * | str | ) |
A universal way to print raw string as trace message (usually used to print a string data in case of BINARY mode).
| void zb_trace_unlock | ( | void | ) |
Unlock the trace object. Completely platform depended function