From c51264d4b323fedf169abd3d8fe4ba00c32fcf64 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 15 Oct 2024 16:51:21 +0200 Subject: [PATCH] examples/gcoap: upgrade users of deprecated nanocoap APIs --- examples/gcoap/client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/gcoap/client.c b/examples/gcoap/client.c index a2b31ff04082f..f603321729c14 100644 --- a/examples/gcoap/client.c +++ b/examples/gcoap/client.c @@ -133,16 +133,16 @@ static void _resp_handler(const gcoap_request_memo_t *memo, coap_pkt_t* pdu, uri_parser_result_t urip; uri_parser_process(&urip, _last_req_uri, strlen(_last_req_uri)); if (*_proxy_uri) { - gcoap_req_init(pdu, (uint8_t *)pdu->hdr, CONFIG_GCOAP_PDU_BUF_SIZE, + gcoap_req_init(pdu, pdu->buf, CONFIG_GCOAP_PDU_BUF_SIZE, COAP_METHOD_GET, NULL); } else { - gcoap_req_init(pdu, (uint8_t *)pdu->hdr, CONFIG_GCOAP_PDU_BUF_SIZE, + gcoap_req_init(pdu, pdu->buf, CONFIG_GCOAP_PDU_BUF_SIZE, COAP_METHOD_GET, urip.path); } if (msg_type == COAP_TYPE_ACK) { - coap_hdr_set_type(pdu->hdr, COAP_TYPE_CON); + coap_pkt_set_type(pdu, COAP_TYPE_CON); } block.blknum++; coap_opt_add_block2_control(pdu, &block); @@ -153,7 +153,7 @@ static void _resp_handler(const gcoap_request_memo_t *memo, coap_pkt_t* pdu, int len = coap_opt_finish(pdu, COAP_OPT_FINISH_NONE); gcoap_socket_type_t tl = _get_tl(*_proxy_uri ? _proxy_uri : _last_req_uri); - _send((uint8_t *)pdu->hdr, len, remote, memo->context, tl); + _send(pdu->buf, len, remote, memo->context, tl); } else { puts("--- blockwise complete ---"); @@ -340,7 +340,7 @@ int gcoap_cli_cmd(int argc, char **argv) } } - coap_hdr_set_type(pdu.hdr, msg_type); + coap_pkt_set_type(&pdu, msg_type); size_t paylen = 0; if (apos < argc) {