diff --git a/examples/cord_ep/main.c b/examples/cord_ep/main.c index dae203ebcc..1320af5e25 100644 --- a/examples/cord_ep/main.c +++ b/examples/cord_ep/main.c @@ -50,7 +50,7 @@ static void _on_ep_event(cord_ep_standalone_event_t event) /* define some dummy CoAP resources */ static ssize_t _handler_dummy(coap_pkt_t *pdu, - uint8_t *buf, size_t len, void *ctx) + uint8_t *buf, size_t len, coap_request_ctx_t *ctx) { (void)ctx; @@ -64,7 +64,7 @@ static ssize_t _handler_dummy(coap_pkt_t *pdu, } static ssize_t _handler_info(coap_pkt_t *pdu, - uint8_t *buf, size_t len, void *ctx) + uint8_t *buf, size_t len, coap_request_ctx_t *ctx) { (void)ctx; diff --git a/examples/cord_epsim/main.c b/examples/cord_epsim/main.c index 4dd9b85dca..ee04127637 100644 --- a/examples/cord_epsim/main.c +++ b/examples/cord_epsim/main.c @@ -46,15 +46,15 @@ static ssize_t text_resp(coap_pkt_t *pdu, uint8_t *buf, size_t len, return resp_len + slen; } -static ssize_t handler_info(coap_pkt_t *pdu, uint8_t *buf, size_t len, void *ctx) +static ssize_t handler_info(coap_pkt_t *pdu, uint8_t *buf, size_t len, coap_request_ctx_t *ctx) { (void)ctx; return text_resp(pdu, buf, len, riot_info, COAP_FORMAT_JSON); } -static ssize_t handler_text(coap_pkt_t *pdu, uint8_t *buf, size_t len, void *ctx) +static ssize_t handler_text(coap_pkt_t *pdu, uint8_t *buf, size_t len, coap_request_ctx_t *ctx) { - return text_resp(pdu, buf, len, (char *)ctx, COAP_FORMAT_TEXT); + return text_resp(pdu, buf, len, ctx->context, COAP_FORMAT_TEXT); } static const coap_resource_t resources[] = { diff --git a/examples/nanocoap_server/coap_handler.c b/examples/nanocoap_server/coap_handler.c index 1c07774249..8b179a3a07 100644 --- a/examples/nanocoap_server/coap_handler.c +++ b/examples/nanocoap_server/coap_handler.c @@ -22,7 +22,7 @@ static const uint8_t block2_intro[] = "This is RIOT (Version: "; static const uint8_t block2_board[] = " running on a "; static const uint8_t block2_mcu[] = " board with a "; -static ssize_t _echo_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *context) +static ssize_t _echo_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) { (void)context; char uri[CONFIG_NANOCOAP_URI_MAX]; @@ -37,14 +37,14 @@ static ssize_t _echo_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *co (uint8_t *)sub_uri, sub_uri_len); } -static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *context) +static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) { (void)context; return coap_reply_simple(pkt, COAP_CODE_205, buf, len, COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD)); } -static ssize_t _riot_block2_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *context) +static ssize_t _riot_block2_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) { (void)context; coap_block_slicer_t slicer; @@ -77,7 +77,7 @@ static ssize_t _riot_block2_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, v buf, len, payload_len, &slicer); } -static ssize_t _riot_value_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *context) +static ssize_t _riot_value_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) { (void) context; @@ -112,7 +112,7 @@ static ssize_t _riot_value_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, vo COAP_FORMAT_TEXT, (uint8_t*)rsp, p); } -ssize_t _sha256_handler(coap_pkt_t* pkt, uint8_t *buf, size_t len, void *context) +ssize_t _sha256_handler(coap_pkt_t* pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) { (void)context;