From dd458cb993c9bfdf4d60014e4f3e9f4e65b3e786 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 17 May 2024 14:26:34 +0200 Subject: [PATCH] nanocoap_sock: use normal udp sock in nanocoap_server() --- sys/net/application_layer/nanocoap/sock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/application_layer/nanocoap/sock.c b/sys/net/application_layer/nanocoap/sock.c index a095c5e80a89..572839dd0fdb 100644 --- a/sys/net/application_layer/nanocoap/sock.c +++ b/sys/net/application_layer/nanocoap/sock.c @@ -789,7 +789,7 @@ ssize_t nanocoap_get_blockwise_url_to_buf(const char *url, int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize) { - nanocoap_sock_t sock; + sock_udp_t sock; sock_udp_ep_t remote; coap_request_ctx_t ctx = { .remote = &remote, @@ -799,7 +799,7 @@ int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize) local->port = COAP_PORT; } - ssize_t res = sock_udp_create(&sock.udp, local, NULL, 0); + ssize_t res = sock_udp_create(&sock, local, NULL, 0); if (res != 0) { return -1; } @@ -814,7 +814,7 @@ int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize) aux_in_ptr = &aux_in; #endif - res = sock_udp_recv_aux(&sock.udp, buf, bufsize, SOCK_NO_TIMEOUT, + res = sock_udp_recv_aux(&sock, buf, bufsize, SOCK_NO_TIMEOUT, &remote, aux_in_ptr); if (res <= 0) { DEBUG("nanocoap: error receiving UDP packet %" PRIdSIZE "\n", res); @@ -844,7 +844,7 @@ int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize) continue; } - sock_udp_send_aux(&sock.udp, buf, res, &remote, aux_out_ptr); + sock_udp_send_aux(&sock, buf, res, &remote, aux_out_ptr); } return 0;