![]() |
WL865E4-P
36.07.001
|
This section describes the M2MB APIs to perform various debug logging operations. More...
#define | M2MB_DBG_EMERG(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_EMERG, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_ALERT(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ALERT, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_CRIT(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_CRIT, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_ERROR(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ERROR, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_WARN(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_WARN, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_NOTICE(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_NOTICE, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_INFO(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_INFO, __func__, __LINE__, __VA_ARGS__) |
#define | M2MB_DBG_DEBUG(...) m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_DEBUG, __func__, __LINE__, __VA_ARGS__) |
enum | M2MB_DBG_LOG_SEVERITY { M2MB_DBG_LOG_SEVERITY_INVALID = -1, M2MB_DBG_LOG_SEVERITY_LOGING_OFF = 0, M2MB_DBG_LOG_SEVERITY_EMERG, M2MB_DBG_LOG_SEVERITY_ALERT, M2MB_DBG_LOG_SEVERITY_CRIT, M2MB_DBG_LOG_SEVERITY_ERROR, M2MB_DBG_LOG_SEVERITY_WARN, M2MB_DBG_LOG_SEVERITY_NOTICE, M2MB_DBG_LOG_SEVERITY_INFO, M2MB_DBG_LOG_SEVERITY_DEBUG } |
M2MB_DBG_LOG_SEVERITY defines different debug category. More... | |
typedef enum M2MB_DBG_LOG_SEVERITY | M2MB_DBG_LOG_SEVERITY_T |
M2MB_DBG_LOG_SEVERITY defines different debug category. More... | |
typedef INT32(* | M2MB_DBG_CMD_CB_T) (VOID *userCtx, UINT32 len, UINT8 *cmd) |
typedef struct M2MB_DBG_CFG | M2MB_DBG_CFG_T |
Debug module configuration context. More... | |
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. More... | |
INT32 | m2mb_dbg_is_init (VOID) |
m2mb_dbg_is_init is called to check if dbg module is initialized. More... | |
INT32 | m2mb_dbg_prepare_for_deepsleep (VOID) |
m2mb_dbg_prepare_for_deepsleep is called to make the dbg module ready for deepsleep. More... | |
INT32 | m2mb_dbg_reinit (VOID) |
m2mb_dbg_reinit is called after coming out of deepsleep. More... | |
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. More... | |
INT32 | m2mb_dbg_consol_print (char *format,...) |
m2mb_dbg_consol_print is called to print to the console. More... | |
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. More... | |
M2MB_DBG_LOG_SEVERITY_T | m2mb_dbg_get_severity (VOID) |
m2mb_dbg_get_severity is called to get the severity level. More... | |
This section describes the M2MB APIs to perform various debug logging operations.
Debug module uses a UART port to send the debug information. The UART port to send can be configured by the user. The UART driver takes care of sending the debug log using DMA. Logs are stored in a circular buffer, while previous logs are being sent over UART.
Debug module creates a dbg thread of low priority which is used to trigger the log sending procedure once the previous log send procedure is over. Apart from logging feature, debug module provides API to send the information immediately over console and also receives command over UART, if CLI option is enabled during initialization procedure.
#define M2MB_DBG_ALERT | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ALERT, __func__, __LINE__, __VA_ARGS__) |
Definition at line 80 of file m2mb_dbg.h.
#define M2MB_DBG_CRIT | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_CRIT, __func__, __LINE__, __VA_ARGS__) |
Definition at line 84 of file m2mb_dbg.h.
#define M2MB_DBG_DEBUG | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_DEBUG, __func__, __LINE__, __VA_ARGS__) |
Definition at line 104 of file m2mb_dbg.h.
#define M2MB_DBG_EMERG | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_EMERG, __func__, __LINE__, __VA_ARGS__) |
Definition at line 76 of file m2mb_dbg.h.
#define M2MB_DBG_ERROR | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_ERROR, __func__, __LINE__, __VA_ARGS__) |
Definition at line 88 of file m2mb_dbg.h.
#define M2MB_DBG_INFO | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_INFO, __func__, __LINE__, __VA_ARGS__) |
Definition at line 100 of file m2mb_dbg.h.
#define M2MB_DBG_NOTICE | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_NOTICE, __func__, __LINE__, __VA_ARGS__) |
Definition at line 96 of file m2mb_dbg.h.
#define M2MB_DBG_WARN | ( | ... | ) | m2mb_dbg_msg_log(M2MB_DBG_LOG_SEVERITY_WARN, __func__, __LINE__, __VA_ARGS__) |
Definition at line 92 of file m2mb_dbg.h.
typedef struct M2MB_DBG_CFG M2MB_DBG_CFG_T |
Debug module configuration context.
Structure to configure the module. This is used while initializing the module.
Definition at line 132 of file m2mb_dbg.h.
typedef enum M2MB_DBG_LOG_SEVERITY M2MB_DBG_LOG_SEVERITY_T |
M2MB_DBG_LOG_SEVERITY defines different debug category.
This enum is used to select various debug log severity levels.
M2MB_DBG_LOG_SEVERITY defines different debug category.
This enum is used to select various debug log severity levels.
Definition at line 118 of file m2mb_dbg.h.
INT32 m2mb_dbg_consol_print | ( | char * | format, |
... | |||
) |
m2mb_dbg_consol_print is called to print to the console.
m2mb_dbg_consol_print prints to the console. The print is unformatted unlike the debug log.
[in] | format | Format of the content to be sent over console. |
M2MB_DBG_LOG_SEVERITY_T m2mb_dbg_get_severity | ( | VOID | ) |
m2mb_dbg_get_severity is called to get the severity level.
m2mb_dbg_get_severity returns the current severity level set.
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.
m2mb_ntp_init initializes the NTP module.
[in] | pCfg | Debug module configuration. |
[in] | uart_cfg | UART port configuration. |
m2mb_dbg_is_init is called to check if dbg module is initialized.
m2mb_dbg_is_init checks if the dbg module is initialized.
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_msg_log logs the debug information. If there is no write process happening then it stores the information in a circular buffer to send it log information in first in first out basis.
[in] | severity | Severity of the message. |
[in] | sourceFilePath | Source file path of the log. |
[in] | lineNumber | Line number of the log. |
[in] | format | Format of the message. |
Example
m2mb_dbg_prepare_for_deepsleep is called to make the dbg module ready for deepsleep.
m2mb_dbg_prepare_for_deepsleep makes the dbg module ready for deepsleep.
m2mb_dbg_reinit is called after coming out of deepsleep.
m2mb_dbg_reinit reinitializes the dbg module after coming out of deepsleep.
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.
m2mb_dbg_set_severity sets the severity level and logs only those severity level debug prints which are lower or equal to the value set.
[in] | severityLevel | Severity level to set. |