10#ifndef TR_DEBUG_PRINT_H
11#define TR_DEBUG_PRINT_H
13#include "tr_plugin_config.h"
16#define DEBUG_BLACK "\033[30m"
17#define DEBUG_RED "\033[31m"
18#define DEBUG_GREEN "\033[32m"
19#define DEBUG_YELLOW "\033[33m"
20#define DEBUG_BLUE "\033[34m"
21#define DEBUG_MAGENTA "\033[35m"
22#define DEBUG_CYAN "\033[36m"
23#define DEBUG_WHITE "\033[37m"
24#define DEBUG_DEFAULT "\033[39m"
25#define DEBUG_RESET "\033[m"
28#ifndef TR_DEBUG_PRINT_COLOR_ENABLED
29#ifdef TR_DEBUG_PRINT_STACK_ENABLED
30#define TR_DEBUG_PRINT_STACK_COLOR DEBUG_DEFAULT
32#ifdef TR_DEBUG_PRINT_CORE_ENABLED
33#define TR_DEBUG_PRINT_CORE_COLOR DEBUG_DEFAULT
35#ifdef TR_DEBUG_PRINT_APP_ENABLED
36#define TR_DEBUG_PRINT_APP_COLOR DEBUG_DEFAULT
38#ifdef TR_DEBUG_PRINT_ZCL_ENABLED
39#define TR_DEBUG_PRINT_ZCL_COLOR DEBUG_DEFAULT
41#ifdef TR_DEBUG_PRINT_RX_MSGS_ENABLED
42#define TR_DEBUG_PRINT_RX_MSGS_COLOR DEBUG_DEFAULT
57#ifdef TR_DEBUG_PRINT_STACK_ENABLED
58#define tr_stack_printf(...) tr_debug_printf(TR_DEBUG_PRINT_STACK, TR_DEBUG_PRINT_STACK_COLOR, __VA_ARGS__)
59#define tr_stack_println(...) tr_debug_println(TR_DEBUG_PRINT_STACK, TR_DEBUG_PRINT_STACK_COLOR, __VA_ARGS__)
61#define tr_stack_printf(...)
62#define tr_stack_println(...)
65#ifdef TR_DEBUG_PRINT_CORE_ENABLED
66#define tr_core_printf(...) tr_debug_printf(TR_DEBUG_PRINT_CORE, TR_DEBUG_PRINT_CORE_COLOR, __VA_ARGS__)
67#define tr_core_println(...) tr_debug_println(TR_DEBUG_PRINT_CORE, TR_DEBUG_PRINT_CORE_COLOR, __VA_ARGS__)
69#define tr_core_printf(...)
70#define tr_core_println(...)
73#ifdef TR_DEBUG_PRINT_APP_ENABLED
74#define tr_app_printf(...) tr_debug_printf(TR_DEBUG_PRINT_APP, TR_DEBUG_PRINT_APP_COLOR, __VA_ARGS__)
75#define tr_app_println(...) tr_debug_println(TR_DEBUG_PRINT_APP, TR_DEBUG_PRINT_APP_COLOR, __VA_ARGS__)
77#define tr_app_printf(...)
78#define tr_app_println(...)
81#ifdef TR_DEBUG_PRINT_ZCL_ENABLED
82#define tr_zcl_printf(...) tr_debug_printf(TR_DEBUG_PRINT_ZCL, TR_DEBUG_PRINT_ZCL_COLOR, __VA_ARGS__)
83#define tr_zcl_println(...) tr_debug_println(TR_DEBUG_PRINT_ZCL, TR_DEBUG_PRINT_ZCL_COLOR, __VA_ARGS__)
85#define tr_zcl_printf(...)
86#define tr_zcl_println(...)
89#ifdef TR_DEBUG_PRINT_RX_MSGS_ENABLED
90#define tr_rxmsgs_printf(...) tr_debug_printf(TR_DEBUG_PRINT_RX_MSGS, TR_DEBUG_PRINT_RX_MSGS_COLOR, __VA_ARGS__)
91#define tr_rxmsgs_println(...) tr_debug_println(TR_DEBUG_PRINT_RX_MSGS, TR_DEBUG_PRINT_RX_MSGS_COLOR, __VA_ARGS__)
93#define tr_rxmsgs_printf(...)
94#define tr_rxmsgs_println(...)
void tr_disable_print_group(tr_debug_print_group_t group)
TODO - documentation.
zb_uint32_t tr_get_print_group_mask(void)
TODO - documentation.
void tr_enable_print_group(tr_debug_print_group_t group)
TODO - documentation.
zb_bool_t tr_check_print_group(tr_debug_print_group_t group)
TODO - documentation.
void tr_debug_println(tr_debug_print_group_t group, const char *color, const char *fmt,...)
void tr_debug_printf(tr_debug_print_group_t group, const char *color, const char *fmt,...)
tr_debug_print_group_t
Definition tr_debug_print.h:48
@ TR_DEBUG_PRINT_ZCL
Definition tr_debug_print.h:52
@ TR_DEBUG_PRINT_APP
Definition tr_debug_print.h:51
@ TR_DEBUG_PRINT_CORE
Definition tr_debug_print.h:50
@ TR_DEBUG_PRINT_ALL
Definition tr_debug_print.h:54
@ TR_DEBUG_PRINT_RX_MSGS
Definition tr_debug_print.h:53
@ TR_DEBUG_PRINT_STACK
Definition tr_debug_print.h:49
char * tr_find_cluster_name(zb_uint16_t cluster_id)
zb_uint16_t cluster_id
Definition tr_nvram_attr.h:24