diff options
| author | MurphyZhao <[email protected]> | 2018-11-01 18:20:03 +0800 |
|---|---|---|
| committer | MurphyZhao <[email protected]> | 2018-11-01 18:21:41 +0800 |
| commit | 58a6b51236498de0bf8cbdb6ee7b172ebc442314 (patch) | |
| tree | 4adb5031a25f3403b3027c42db54cc8189da10f8 /components/net/sal_socket/impl | |
| parent | f08039ff6fc0c833bc7b257685e796e21482cc58 (diff) | |
[components][dfs] AND [components][net][sal] 适配 LWIP210
Signed-off-by: MurphyZhao <[email protected]>
Diffstat (limited to 'components/net/sal_socket/impl')
| -rw-r--r-- | components/net/sal_socket/impl/af_inet_lwip.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c index 41ea9ac968..b1e04373c6 100644 --- a/components/net/sal_socket/impl/af_inet_lwip.c +++ b/components/net/sal_socket/impl/af_inet_lwip.c @@ -33,6 +33,15 @@ #ifdef SAL_USING_LWIP #ifdef SAL_USING_POSIX + +#if LWIP_VERSION >= 0x20100ff +#include <lwip/priv/sockets_priv.h> + +#if LWIP_NETCONN_FULLDUPLEX +#error "Not support" +#endif + +#else /* LWIP_VERSION < 0x20100ff */ /* * Re-define lwip socket * @@ -64,6 +73,7 @@ struct lwip_sock { rt_wqueue_t wait_head; }; +#endif /* LWIP_VERSION >= 0x20100ff */ extern struct lwip_sock *lwip_tryget_socket(int s); @@ -136,7 +146,11 @@ static void event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len break; } - if (sock->lastdata || sock->rcvevent > 0) +#if LWIP_VERSION >= 0x20100ff + if ((void*)(sock->lastdata.pbuf) || (sock->rcvevent > 0)) +#else + if ((void*)(sock->lastdata) || (sock->rcvevent > 0)) +#endif event |= POLLIN; if (sock->sendevent) event |= POLLOUT; @@ -226,7 +240,12 @@ static int inet_poll(struct dfs_fd *file, struct rt_pollreq *req) rt_poll_add(&sock->wait_head, req); level = rt_hw_interrupt_disable(); - if (sock->lastdata || sock->rcvevent) + +#if LWIP_VERSION >= 0x20100ff + if ((void*)(sock->lastdata.pbuf) || sock->rcvevent) +#else + if ((void*)(sock->lastdata) || sock->rcvevent) +#endif { mask |= POLLIN; } |
