Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
tr_debug_print_stubs.h
Go to the documentation of this file.
1
10#ifndef TR_DEBUG_PRINT_STUBS_H
11#define TR_DEBUG_PRINT_STUBS_H
12
13#include "zb_common.h"
14
24
25#define tr_stack_printf(...)
26#define tr_stack_println(...)
27
28#define tr_core_printf(...)
29#define tr_core_println(...)
30
31#define tr_app_printf(...)
32#define tr_app_println(...)
33
34#define tr_zcl_printf(...)
35#define tr_zcl_println(...)
36
37#define tr_rxmsgs_printf(...)
38#define tr_rxmsgs_println(...)
39
40static inline zb_uint32_t tr_get_print_group_mask(void)
41{
42 return 0;
43}
44
45static inline void tr_enable_print_group(tr_debug_print_group_t group)
46{
47 (void)group;
48}
49
50static inline void tr_disable_print_group(tr_debug_print_group_t group)
51{
52 (void)group;
53}
54
55static inline zb_bool_t tr_check_print_group(tr_debug_print_group_t group)
56{
57 (void)group;
58 return ZB_FALSE;
59}
60
61// if CLI exists without debug print then we need to stub out printf
62#if !defined(TR_DEBUG_PRINT_PLUGIN_ENABLE)
63#if defined(TR_CLI_PLUGIN_ENABLE)
64#include "tr_cli.h"
65
66__attribute__((weak)) void tr_printf_init(putchar_cb putc,
67 putstr_cb puts)
68{
69 (void)putc;
70 (void)puts;
71}
72
73__attribute__((weak)) void tr_vsprintf(char *buf,
74 int maxlen,
75 const char *fmt,
76 va_list args)
77{
78 (void)maxlen;
79 (void)fmt;
80 (void)args;
81
82 if (buf != 0)
83 {
84 buf[0] = '\0';
85 }
86}
87
88__attribute__((weak)) void tr_printf(const char *fmt,
89 ...)
90{
91 (void)fmt;
92}
93
94#endif /* if defined(TR_CLI_PLUGIN_ENABLE) */
95
96__attribute__((weak)) int _write(int fd,
97 const char *ptr,
98 int len)
99{
100 (void)fd;
101 (void)ptr;
102 return len;
103}
104
105__attribute__((weak)) int _read(int fd,
106 const char *ptr,
107 int len)
108{
109 (void)fd;
110 (void)ptr;
111 (void)len;
112 return 0;
113}
114
115#endif /* if !defined(TR_DEBUG_PRINT_PLUGIN_ENABLE) */
116
117#endif // TR_DEBUG_PRINT_STUBS_H
void tr_disable_print_group(tr_debug_print_group_t group)
disable a print group
zb_uint32_t tr_get_print_group_mask(void)
get the print group mask
void tr_enable_print_group(tr_debug_print_group_t group)
enable a print group
zb_bool_t tr_check_print_group(tr_debug_print_group_t group)
check to see if a print group is enabled
tr_debug_print_group_t
Definition tr_debug_print.h:47
@ TR_DEBUG_PRINT_ZCL
Definition tr_debug_print.h:51
@ TR_DEBUG_PRINT_APP
Definition tr_debug_print.h:50
@ TR_DEBUG_PRINT_CORE
Definition tr_debug_print.h:49
@ TR_DEBUG_PRINT_ALL
Definition tr_debug_print.h:53
@ TR_DEBUG_PRINT_RX_MSGS
Definition tr_debug_print.h:52
@ TR_DEBUG_PRINT_STACK
Definition tr_debug_print.h:48
int _write(int fd, const char *ptr, int len)
Definition tr_debug_print_stubs.h:96
int _read(int fd, const char *ptr, int len)
Definition tr_debug_print_stubs.h:105