diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c index 793568d836b82b0eaf14011a2fe60238478192c5..3cdb637d1545b7045e818c4e38579ceb2b3e30b7 100644 --- a/components/net/lwip-1.4.1/src/arch/sys_arch.c +++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c @@ -515,10 +515,19 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) return tick; } -/** Wait for a new message to arrive in the mbox +/** + * @ingroup sys_mbox + * This is similar to sys_arch_mbox_fetch, however if a message is not + * present in the mailbox, it immediately returns with the code + * SYS_MBOX_EMPTY. On success 0 is returned. + * To allow for efficient implementations, this can be defined as a + * function-like macro in sys_arch.h instead of a normal function. For + * example, a naive implementation could be: + * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) + * although this would introduce unnecessary delays. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message * @return 0 (milliseconds) if a message has been received * or SYS_MBOX_EMPTY if the mailbox is empty */ @@ -534,7 +543,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) else { if (ret == RT_EOK) - ret = 1; + ret = 0; } return ret; diff --git a/components/net/lwip-2.0.2/src/arch/sys_arch.c b/components/net/lwip-2.0.2/src/arch/sys_arch.c index 3de85b338c510328a03d513dcb9115e6328a3d73..b779264f967df5046e9bd7b9a0a129c943b8d84a 100644 --- a/components/net/lwip-2.0.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.2/src/arch/sys_arch.c @@ -526,10 +526,19 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) return tick; } -/** Wait for a new message to arrive in the mbox +/** + * @ingroup sys_mbox + * This is similar to sys_arch_mbox_fetch, however if a message is not + * present in the mailbox, it immediately returns with the code + * SYS_MBOX_EMPTY. On success 0 is returned. + * To allow for efficient implementations, this can be defined as a + * function-like macro in sys_arch.h instead of a normal function. For + * example, a naive implementation could be: + * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) + * although this would introduce unnecessary delays. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message * @return 0 (milliseconds) if a message has been received * or SYS_MBOX_EMPTY if the mailbox is empty */ @@ -544,7 +553,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) else { if (ret == RT_EOK) - ret = 1; + ret = 0; } return ret; diff --git a/components/net/lwip-2.0.3/src/arch/sys_arch.c b/components/net/lwip-2.0.3/src/arch/sys_arch.c index 3de85b338c510328a03d513dcb9115e6328a3d73..b779264f967df5046e9bd7b9a0a129c943b8d84a 100644 --- a/components/net/lwip-2.0.3/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.3/src/arch/sys_arch.c @@ -526,10 +526,19 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) return tick; } -/** Wait for a new message to arrive in the mbox +/** + * @ingroup sys_mbox + * This is similar to sys_arch_mbox_fetch, however if a message is not + * present in the mailbox, it immediately returns with the code + * SYS_MBOX_EMPTY. On success 0 is returned. + * To allow for efficient implementations, this can be defined as a + * function-like macro in sys_arch.h instead of a normal function. For + * example, a naive implementation could be: + * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) + * although this would introduce unnecessary delays. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message * @return 0 (milliseconds) if a message has been received * or SYS_MBOX_EMPTY if the mailbox is empty */ @@ -544,7 +553,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) else { if (ret == RT_EOK) - ret = 1; + ret = 0; } return ret; diff --git a/components/net/lwip-2.1.2/src/arch/sys_arch.c b/components/net/lwip-2.1.2/src/arch/sys_arch.c index a7d3f9896878966e5d218f6c2fda60aa0c98749d..62dc4930079a60073fbe65438c5ad0c348bc02fd 100644 --- a/components/net/lwip-2.1.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/src/arch/sys_arch.c @@ -540,10 +540,19 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) return tick; } -/** Wait for a new message to arrive in the mbox +/** + * @ingroup sys_mbox + * This is similar to sys_arch_mbox_fetch, however if a message is not + * present in the mailbox, it immediately returns with the code + * SYS_MBOX_EMPTY. On success 0 is returned. + * To allow for efficient implementations, this can be defined as a + * function-like macro in sys_arch.h instead of a normal function. For + * example, a naive implementation could be: + * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) + * although this would introduce unnecessary delays. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message * @return 0 (milliseconds) if a message has been received * or SYS_MBOX_EMPTY if the mailbox is empty */ @@ -558,7 +567,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) else { if (ret == RT_EOK) - ret = 1; + ret = 0; } return ret;