From 82929ccea37474f2a02edb968c94d2812a2eda09 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 5 May 2023 15:17:34 +0200 Subject: [PATCH] nanocoap_sock: remove nanocoap_get() The function has been deprecated in favor of nanocoap_sock_get() --- sys/include/net/nanocoap_sock.h | 21 ++------------------- sys/net/application_layer/nanocoap/sock.c | 16 ---------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/sys/include/net/nanocoap_sock.h b/sys/include/net/nanocoap_sock.h index a704639cb0..ebe0acb5d2 100644 --- a/sys/include/net/nanocoap_sock.h +++ b/sys/include/net/nanocoap_sock.h @@ -65,8 +65,8 @@ * * Follow the instructions in the section _Write Options and Payload_ below. * - * To send the message and await the response, see nanocoap_request() as well - * as nanocoap_get(), which additionally copies the response payload to a user + * To send the message and await the response, see nanocoap_sock_request() as well + * as nanocoap_sock_get(), which additionally copies the response payload to a user * supplied buffer. Finally, read the response as described above in the server * _Handler functions_ section for reading a request. * @@ -565,23 +565,6 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt, ssize_t nanocoap_request(coap_pkt_t *pkt, const sock_udp_ep_t *local, const sock_udp_ep_t *remote, size_t len); -/** - * @brief Simple synchronous CoAP (confirmable) get - * - * @deprecated Will be removed after the 2023.04 release. - * Please use @ref nanocoap_sock_get instead. - * - * @param[in] remote remote UDP endpoint - * @param[in] path remote path - * @param[out] buf buffer to write response to - * @param[in] len length of @p buffer - * - * @returns length of response payload on success - * @returns <0 on error - */ -ssize_t nanocoap_get(const sock_udp_ep_t *remote, const char *path, - void *buf, size_t len); - /** * @brief Initialize block request context by URL and connect a socket * diff --git a/sys/net/application_layer/nanocoap/sock.c b/sys/net/application_layer/nanocoap/sock.c index 7eec11f1d3..35bcb62d66 100644 --- a/sys/net/application_layer/nanocoap/sock.c +++ b/sys/net/application_layer/nanocoap/sock.c @@ -548,22 +548,6 @@ ssize_t nanocoap_request(coap_pkt_t *pkt, const sock_udp_ep_t *local, return res; } -ssize_t nanocoap_get(const sock_udp_ep_t *remote, const char *path, void *buf, size_t len) -{ - int res; - nanocoap_sock_t sock; - - res = nanocoap_sock_connect(&sock, NULL, remote); - if (res) { - return res; - } - - res = nanocoap_sock_get(&sock, path, buf, len); - nanocoap_sock_close(&sock); - - return res; -} - static int _block_cb(void *arg, coap_pkt_t *pkt) { _block_ctx_t *ctx = arg;