WL865E4-P  36.07.001
m2mb_dbg.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
41 #ifndef M2MB_DBG_API_H
42 #define M2MB_DBG_API_H
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
63 /*-----------------------------------------------------------------------------------------------*/
64 
69 /*-----------------------------------------------------------------------------------------------*/
70 
71 
72 /* Global declarations ==========================================================================*/
73 //static UINT8 cmd[128];
74 
75 /* Macro to be called by an application to log debug message at EMERGENCY log level */
76 #define M2MB_DBG_EMERG(...) \
77  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_EMERG, __func__, __LINE__, __VA_ARGS__)
78 
79 /* Macro to be called by an application to log debug message at ALERT log level */
80 #define M2MB_DBG_ALERT(...) \
81  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ALERT, __func__, __LINE__, __VA_ARGS__)
82 
83 /* Macro to be called by an application to log debug message at CRITICAL log level */
84 #define M2MB_DBG_CRIT(...) \
85  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_CRIT, __func__, __LINE__, __VA_ARGS__)
86 
87 /* Macro to be called by an application to log debug message at ERROR log level */
88 #define M2MB_DBG_ERROR(...) \
89  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ERROR, __func__, __LINE__, __VA_ARGS__)
90 
91 /* Macro to be called by an application to log debug message at WARNING log level */
92 #define M2MB_DBG_WARN(...) \
93  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_WARN, __func__, __LINE__, __VA_ARGS__)
94 
95 /* Macro to be called by an application to log debug message at NOTICE log level */
96 #define M2MB_DBG_NOTICE(...) \
97  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_NOTICE, __func__, __LINE__, __VA_ARGS__)
98 
99 /* Macro to be called by an application to log debug message at INFORMATION log level */
100 #define M2MB_DBG_INFO(...) \
101  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_INFO, __func__, __LINE__, __VA_ARGS__)
102 
103 /* Macro to be called by an application to log debug message at DEBUG log level */
104 #define M2MB_DBG_DEBUG(...) \
105  m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_DEBUG, __func__, __LINE__, __VA_ARGS__)
106 
107 
108 
109 /* Global typedefs ==============================================================================*/
119 {
131 
132 typedef INT32 (* M2MB_DBG_CMD_CB_T )( VOID *userCtx, UINT32 len, UINT8* cmd );
133 
141 typedef struct M2MB_DBG_CFG
142 {
152 
153 /* Global functions =========================================================*/
154 /*---------------------------------------------------------------------------*/
196 /*---------------------------------------------------------------------------*/
198 
199 /*---------------------------------------------------------------------------*/
219 /*---------------------------------------------------------------------------*/
221 
222 /*---------------------------------------------------------------------------*/
243 /*---------------------------------------------------------------------------*/
245 
246 /*---------------------------------------------------------------------------*/
266 /*---------------------------------------------------------------------------*/
268 
269 /*---------------------------------------------------------------------------*/
305 /*---------------------------------------------------------------------------*/
307  char const *sourceFilePath, UINT32 lineNumber, char *format, ...);
308 
309 /*---------------------------------------------------------------------------*/
334 /*---------------------------------------------------------------------------*/
335 INT32 m2mb_dbg_consol_print( char *format, ...);
336 
337 /*---------------------------------------------------------------------------*/
361 /*---------------------------------------------------------------------------*/
363 
364 /*---------------------------------------------------------------------------*/
385 /*---------------------------------------------------------------------------*/
387 
391 /*-----------------------------------------------------------------------------------------------*/
392 
393 #ifdef __cplusplus
394 }
395 #endif
396 #endif
unsigned char UINT8
Definition: m2mb_types.h:83
INT32 m2mb_dbg_reinit(VOID)
m2mb_dbg_reinit is called after coming out of deepsleep.
M2MB_DBG_LOG_SEVERITY_T logLevel
Definition: m2mb_dbg.h:145
Debug module configuration context.
Definition: m2mb_dbg.h:141
INT32 M2MB_STATUS_T
Definition: m2mb_status.h:95
INT32 m2mb_dbg_prepare_for_deepsleep(VOID)
m2mb_dbg_prepare_for_deepsleep is called to make the dbg module ready for deepsleep.
UINT16 bufferSize
Definition: m2mb_dbg.h:144
M2MB_UART_PORT_ID_E port
Definition: m2mb_dbg.h:143
INT32 m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_T severity, char const *sourceFilePath, UINT32 lineNumber, char *format,...)
m2mb_dbg_msg_log is called to log debug information.
M2MB_DBG_LOG_SEVERITY
M2MB_DBG_LOG_SEVERITY defines different debug category.
Definition: m2mb_dbg.h:118
M2MB_DBG_CMD_CB_T cb
Definition: m2mb_dbg.h:148
unsigned short UINT16
Definition: m2mb_types.h:84
INT32 m2mb_dbg_consol_print(char *format,...)
m2mb_dbg_consol_print is called to print to the console.
M2MB_DBG_LOG_SEVERITY_T m2mb_dbg_get_severity(VOID)
m2mb_dbg_get_severity is called to get the severity level.
INT32 m2mb_dbg_init(M2MB_DBG_CFG_T *pCfg, M2MB_UART_CONFIG_T *uart_cfg)
m2mb_dbg_init is called to initialize the debug module.
unsigned long int UINT32
Definition: m2mb_types.h:85
M2MB_STATUS_T m2mb_dbg_set_severity(M2MB_DBG_LOG_SEVERITY_T severityLevel)
m2mb_dbg_set_severity is called to set the severity level to log.
enum M2MB_DBG_LOG_SEVERITY M2MB_DBG_LOG_SEVERITY_T
M2MB_DBG_LOG_SEVERITY defines different debug category.
struct M2MB_DBG_CFG M2MB_DBG_CFG_T
Debug module configuration context.
void VOID
Definition: m2mb_types.h:72
M2MB_UART_PORT_ID_E
UART Port Identifier enumeration.
Definition: m2mb_uart.h:129
Structure to configure UART module.
Definition: m2mb_uart.h:182
signed int INT32
Definition: m2mb_types.h:80
INT32 m2mb_dbg_is_init(VOID)
m2mb_dbg_is_init is called to check if dbg module is initialized.
INT32(* M2MB_DBG_CMD_CB_T)(VOID *userCtx, UINT32 len, UINT8 *cmd)
Definition: m2mb_dbg.h:132
VOID * cbCtx
Definition: m2mb_dbg.h:149
UINT8 enableCI
Definition: m2mb_dbg.h:147