1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/nanocoap_cli: provide coap_request_ctx_t

This commit is contained in:
Benjamin Valentin 2022-10-28 14:16:40 +02:00 committed by Benjamin Valentin
parent 55e13a9d61
commit fd42f72b20

View File

@ -59,11 +59,15 @@ static int _nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize,
}
else {
coap_pkt_t pkt;
coap_request_ctx_t ctx = {
.remote = &remote,
};
if (coap_parse(&pkt, (uint8_t *)buf, res) < 0) {
DEBUG("nanocoap: error parsing packet\n");
continue;
}
if ((res = coap_handle_req(&pkt, buf, bufsize)) > 0) {
if ((res = coap_handle_req(&pkt, buf, bufsize, &ctx)) > 0) {
res = sock_udp_send(&sock, buf, res, &remote);
}
}