mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
nanocoap_sock: remove nanocoap_get()
The function has been deprecated in favor of nanocoap_sock_get()
This commit is contained in:
parent
bf95fa4909
commit
82929ccea3
@ -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
|
||||
*
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user