📄 net_err.h
字号:
#define NET_SOCK_ERR_INVALID_PORT_NBR 41070 /* Invalid port nbr. */
#define NET_SOCK_ERR_INVALID_PORT_Q_NBR_USED 41071 /* Invalid nbr Q entries used. */
#define NET_SOCK_ERR_PORT_NBR_NONE_AVAIL 41075 /* Port nbr(s) NOT avail. */
#define NET_SOCK_ERR_PORT_NBR_IN_Q 41076 /* Port nbr cur in Q. */
#define NET_SOCK_ERR_CONN_IN_USE 41100 /* Sock conn cur in use. */
#define NET_SOCK_ERR_CONN_IN_PROGRESS 41101 /* Sock conn NOT complete. */
#define NET_SOCK_ERR_CONN_CLOSED 41105 /* Sock conn closed. */
#define NET_SOCK_ERR_CONN_CLOSE_IN_PROGRESS 41106 /* Sock conn close NOT complete. */
#define NET_SOCK_ERR_CONN_FAIL 41110 /* Sock conn op failed. */
#define NET_SOCK_ERR_CONN_CLR 41111 /* Sock conn clr failed. */
#define NET_SOCK_ERR_CONN_ABORT 41112 /* Sock conn abort failed. */
#define NET_SOCK_ERR_CONN_SIGNAL 41120 /* Sock conn signal failed. */
#define NET_SOCK_ERR_CONN_SIGNAL_TIMEOUT 41121 /* Sock conn signal timeout. */
#define NET_SOCK_ERR_CONN_ACCEPT_Q_NONE_AVAIL 41130 /* Sock conn accept Q conn id's NOT avail. */
#define NET_SOCK_ERR_CONN_ACCEPT_Q_MAX 41132 /* Sock conn accept Q max limit. */
#define NET_SOCK_ERR_CONN_ACCEPT_Q_DUP 41133 /* Sock conn accept Q conn id dup. */
#define NET_SOCK_ERR_RX_Q_CLOSED 41400 /* Rx Q closed; i.e. do NOT rx pkt(s) to Q. */
#define NET_SOCK_ERR_RX_Q_EMPTY 41401 /* Rx Q empty; i.e. NO rx'd pkt(s) in Q. */
#define NET_SOCK_ERR_RX_Q_FULL 41402 /* Rx Q full; i.e. too many rx'd pkt(s) in Q. */
#define NET_SOCK_ERR_RX_Q_CLR 41403 /* Rx Q clr failed. */
#define NET_SOCK_ERR_RX_Q_SIGNAL 41404 /* Rx Q signal failed. */
/*$PAGE*/
/*
*********************************************************************************************************
* MACRO'S
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* NETWORK ARGUMENT CHECK FAILURE MACRO'S
*
* Description : Call application-specific handler function(s) to monitor, log, & handle network error(s).
*
* Argument(s) : id Specific network error code ID.
*
* Return(s) : none.
*
* Caller(s) : various.
*
* These macro's are INTERNAL network protocol suite macro's & SHOULD NOT be called by
* application function(s).
*
* Note(s) : (1) (a) When NET_ERR_CFG_ARG_CHK_EXT_EN is ENABLED, ALL arguments received from any port interface
* provided by the developer or application are checked/validated.
*
* To provide feedback to an application on any port interface argument check failures, the
* developer MUST implement the failure hook function, NetErr_FailArgChkExt(), in
*
* \<Your Product Application>\net_bsp.c
*
* where
* <Your Product Application> directory path for Your Product's Application
*
*
* (b) When NET_ERR_CFG_ARG_CHK_DBG_EN is ENABLED, internal arguments are checked/validated to
* debug the network protocol suite.
*
* To provide feedback to an application on any internal network argument check failures, the
* developer MUST implement the failure hook function, NetErr_FailArgChkDbg(), in
*
* \<Your Product Application>\net_bsp.c
*
* where
* <Your Product Application> directory path for Your Product's Application
*
*
* (2) When argument check failure macro's are used in conjunction with network counter macro's
* (see 'net_ctr.h NETWORK COUNTER MACRO'S'), argument check failure macro MUST be called
* AFTER network counter macro. This ensures that the network counter is adjusted BEFORE
* the failure hook function is called (see Notes #1 & #2).
*
* (3) Argument check identification numbers (id's) are grouped in series of 1000 per module/layer.
*
* (4) (a) #### Argument check failure macro's NOT yet implemented.
*
* (b) #### Argument check failure macro's may NOT be necessary (remove if unnecessary).
*********************************************************************************************************
*/
#if (NET_ERR_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
#define NET_ERR_FAIL_ARG_CHK_EXT(id) { NetErr_FailArgChkExt((CPU_INT16U)id); }
#else
#define NET_ERR_FAIL_ARG_CHK_EXT(id)
#endif
#if (NET_ERR_CFG_ARG_CHK_DBG_EN == DEF_ENABLED)
#define NET_ERR_FAIL_ARG_CHK_DBG(id) { NetErr_FailArgChkDbg((CPU_INT16U)id); }
#else
#define NET_ERR_FAIL_ARG_CHK_DBG(id)
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* DATA TYPES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* ERROR CODES DATA TYPE
*********************************************************************************************************
*/
typedef CPU_INT16U NET_ERR;
/*
*********************************************************************************************************
* GLOBAL VARIABLES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
#if (NET_DBG_CFG_TEST_EN == DEF_ENABLED)
CPU_CHAR *NetErr_GetStr (NET_ERR err_code);
#endif
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
* DEFINED IN PRODUCT'S net_bsp.c
*********************************************************************************************************
*/
#if (NET_ERR_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
void NetErr_FailArgChkExt(CPU_INT16U id);
#endif
#if (NET_ERR_CFG_ARG_CHK_DBG_EN == DEF_ENABLED)
void NetErr_FailArgChkDbg(CPU_INT16U id);
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* CONFIGURATION ERRORS
*********************************************************************************************************
*/
#ifndef NET_ERR_CFG_ARG_CHK_EXT_EN
#error "NET_ERR_CFG_ARG_CHK_EXT_EN not #define'd in 'net_cfg.h'"
#error " [MUST be DEF_DISABLED] "
#error " [ || DEF_ENABLED ] "
#elif ((NET_ERR_CFG_ARG_CHK_EXT_EN != DEF_DISABLED) && \
(NET_ERR_CFG_ARG_CHK_EXT_EN != DEF_ENABLED ))
#error "NET_ERR_CFG_ARG_CHK_EXT_EN illegally #define'd in 'net_cfg.h'"
#error " [MUST be DEF_DISABLED] "
#error " [ || DEF_ENABLED ] "
#endif
#ifndef NET_ERR_CFG_ARG_CHK_DBG_EN
#error "NET_ERR_CFG_ARG_CHK_DBG_EN not #define'd in 'net_cfg.h'"
#error " [MUST be DEF_DISABLED] "
#error " [ || DEF_ENABLED ] "
#elif ((NET_ERR_CFG_ARG_CHK_DBG_EN != DEF_DISABLED) && \
(NET_ERR_CFG_ARG_CHK_DBG_EN != DEF_ENABLED ))
#error "NET_ERR_CFG_ARG_CHK_DBG_EN illegally #define'd in 'net_cfg.h'"
#error " [MUST be DEF_DISABLED] "
#error " [ || DEF_ENABLED ] "
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -