From 0e55b42fd35c85fc61731eddf5edc641022cf9ec Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Tue, 5 May 2020 13:09:24 +0200 Subject: [PATCH] [RIOT] coap_io_riot.c: Update to coap_io_ functions This change replaces calls to the deprecated functions coap_write() and coap_read() with coap_io_prepare_io() and coap_io_do_io(). --- src/coap_io_riot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coap_io_riot.c b/src/coap_io_riot.c index 4166455b..28d8d6d3 100644 --- a/src/coap_io_riot.c +++ b/src/coap_io_riot.c @@ -179,7 +179,7 @@ address_equals(const coap_address_t *a, const ipv6_addr_t *b) { } int -coap_run_once(coap_context_t *ctx, unsigned timeout_ms) { +coap_io_process(coap_context_t *ctx, unsigned timeout_ms) { coap_tick_t before, now; coap_socket_t *sockets[LIBCOAP_MAX_SOCKETS]; unsigned int num_sockets = 0, timeout; @@ -190,7 +190,8 @@ coap_run_once(coap_context_t *ctx, unsigned timeout_ms) { coap_ticks(&before); - timeout = coap_write(ctx, sockets, (unsigned int)(sizeof(sockets) / sizeof(sockets[0])), &num_sockets, before); + timeout = + coap_io_prepare_io(ctx, sockets, ARRAY_SIZE(sockets), &num_sockets, now); if (timeout == 0 || timeout_ms < timeout) timeout = timeout_ms; @@ -269,7 +270,7 @@ coap_run_once(coap_context_t *ctx, unsigned timeout_ms) { } coap_ticks(&now); - coap_read(ctx, now); + coap_io_do_io(ctx, now); /* cleanup */ gnrc_netreg_unregister(GNRC_NETTYPE_UDP, &coap_reg);