mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
lwip_sock: update implementation for async callback argument
This commit is contained in:
parent
4bdd138021
commit
29651da8f4
@ -183,7 +183,7 @@ ssize_t sock_ip_send(sock_ip_t *sock, const void *data, size_t len,
|
||||
#ifdef SOCK_HAS_ASYNC
|
||||
void sock_ip_set_cb(sock_ip_t *sock, sock_ip_cb_t cb, void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
sock->base.async_cb_arg = arg;
|
||||
sock->base.async_cb.ip = cb;
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ static void _netconn_cb(struct netconn *conn, enum netconn_evt evt,
|
||||
break;
|
||||
}
|
||||
if (flags && sock->async_cb.gen) {
|
||||
sock->async_cb.gen(sock, flags, NULL);
|
||||
sock->async_cb.gen(sock, flags, sock->async_cb_arg);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -382,14 +382,14 @@ ssize_t sock_tcp_write(sock_tcp_t *sock, const void *data, size_t len)
|
||||
#ifdef SOCK_HAS_ASYNC
|
||||
void sock_tcp_set_cb(sock_tcp_t *sock, sock_tcp_cb_t cb, void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
sock->base.async_cb_arg = arg;
|
||||
sock->base.async_cb.tcp = cb;
|
||||
}
|
||||
|
||||
void sock_tcp_queue_set_cb(sock_tcp_queue_t *queue, sock_tcp_queue_cb_t cb,
|
||||
void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
queue->base.async_cb_arg = arg;
|
||||
queue->base.async_cb.tcp_queue = cb;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ ssize_t sock_udp_send(sock_udp_t *sock, const void *data, size_t len,
|
||||
#ifdef SOCK_HAS_ASYNC
|
||||
void sock_udp_set_cb(sock_udp_t *sock, sock_udp_cb_t cb, void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
sock->base.async_cb_arg = arg;
|
||||
sock->base.async_cb.udp = cb;
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,7 @@ struct lwip_sock_base {
|
||||
sock_udp_cb_t udp; /**< UDP version */
|
||||
#endif
|
||||
} async_cb;
|
||||
void *async_cb_arg; /**< asynchronous callback argument */
|
||||
#ifdef SOCK_HAS_ASYNC_CTX
|
||||
sock_async_ctx_t async_ctx; /**< asynchronous event context */
|
||||
#endif /* SOCK_HAS_ASYNC_CTX */
|
||||
|
Loading…
Reference in New Issue
Block a user