From 23f8a531b177512a3bde27c31757a487afd866b5 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Thu, 22 Apr 2021 16:42:00 +0100 Subject: [PATCH] Nits: Fix documentation Remove a duplicate definition. --- include/coap3/net.h | 12 ++++++------ include/coap3/resource.h | 12 ------------ man/coap_handler.txt.in | 37 +++++++++++++++---------------------- 3 files changed, 21 insertions(+), 40 deletions(-) diff --git a/include/coap3/net.h b/include/coap3/net.h index 59778a20..aa5fda58 100644 --- a/include/coap3/net.h +++ b/include/coap3/net.h @@ -60,34 +60,34 @@ typedef coap_response_t (*coap_response_handler_t)(coap_session_t *session, * @param session CoAP session. * @param sent The PDU that was transmitted. * @param reason The reason for the NACK. - * @param id CoAP message ID. + * @param mid CoAP message ID. */ typedef void (*coap_nack_handler_t)(coap_session_t *session, const coap_pdu_t *sent, const coap_nack_reason_t reason, - const coap_mid_t id); + const coap_mid_t mid); /** * Received Ping handler that is used as callback in coap_context_t. * * @param session CoAP session. * @param received The PDU that was received. - * @param id CoAP message ID. + * @param mid CoAP message ID. */ typedef void (*coap_ping_handler_t)(coap_session_t *session, const coap_pdu_t *received, - const coap_mid_t id); + const coap_mid_t mid); /** * Received Pong handler that is used as callback in coap_context_t. * * @param session CoAP session. * @param received The PDU that was received. - * @param id CoAP message ID. + * @param mid CoAP message ID. */ typedef void (*coap_pong_handler_t)(coap_session_t *session, const coap_pdu_t *received, - const coap_mid_t id); + const coap_mid_t mid); /** * Registers a new message handler that is called whenever a response is diff --git a/include/coap3/resource.h b/include/coap3/resource.h index 19260939..708434a2 100644 --- a/include/coap3/resource.h +++ b/include/coap3/resource.h @@ -353,18 +353,6 @@ coap_print_status_t coap_print_link(const coap_resource_t *resource, size_t *len, size_t *offset); -/** - * Registers the specified @p handler as message handler for the request type @p - * method - * - * @param resource The resource for which the handler shall be registered. - * @param method The CoAP request method to handle. - * @param handler The handler to register with @p resource. - */ -void coap_register_handler(coap_resource_t *resource, - coap_request_t method, - coap_method_handler_t handler); - /** @} */ /** diff --git a/man/coap_handler.txt.in b/man/coap_handler.txt.in index eaf96e9d..c4118e39 100644 --- a/man/coap_handler.txt.in +++ b/man/coap_handler.txt.in @@ -66,12 +66,10 @@ COAP_REQUEST_IPATCH The method handler function prototype is defined as: [source, c] ---- -typedef void (*coap_method_handler_t)(coap_context_t *context, - coap_resource_t *resource, +typedef void (*coap_method_handler_t)(coap_resource_t *resource, coap_session_t *session, - coap_pdu_t *incoming_pdu, - coap_string_t *token, - coap_string_t *query, + const coap_pdu_t *incoming_pdu, + const coap_string_t *query, coap_pdu_t *response_pdu); ---- @@ -99,10 +97,9 @@ typedef enum coap_response_t { COAP_RESPONSE_OK /* Response is fine */ } coap_response_t; -typedef coap_response_t (*coap_response_handler_t)(coap_context_t *context, - coap_session_t *session, - coap_pdu_t *sent, - coap_pdu_t *received, +typedef coap_response_t (*coap_response_handler_t)(coap_session_t *session, + const coap_pdu_t *sent, + const coap_pdu_t *received, const coap_mid_t id); ---- @@ -122,10 +119,9 @@ If _handler_ is NULL, then the handler is de-registered. The nack handler function prototype is defined as: [source, c] ---- -typedef void (*coap_nack_handler_t)(coap_context_t *context, - coap_session_t *session, - coap_pdu_t *sent, - coap_nack_reason_t reason, +typedef void (*coap_nack_handler_t)(coap_session_t *session, + const coap_pdu_t *sent, + const coap_nack_reason_t reason, const coap_mid_t mid); ---- NACKs can be one of the following @@ -144,9 +140,8 @@ NULL, then the handler is de-registered. The ping handler function prototype is defined as: [source, c] ---- -typedef void (*coap_ping_handler_t)(coap_context_t *context, - coap_session_t *session, - coap_pdu_t *received, +typedef void (*coap_ping_handler_t)(coap_session_t *session, + const coap_pdu_t *received, const coap_mid_t mid); ---- @@ -157,9 +152,8 @@ If _handler_ is NULL, then the handler is de-registered. The pong handler function prototype is defined as: [source, c] ---- -typedef void (*coap_pong_handler_t)(coap_context_t *context, - coap_session_t *session, - coap_pdu_t *received, +typedef void (*coap_pong_handler_t)(coap_session_t *session, + const coap_pdu_t *received, const coap_mid_t mid); ---- @@ -170,9 +164,8 @@ the handler is de-registered. The event handler function prototype is defined as: [source, c] ---- -typedef void (*coap_event_handler_t)(coap_context_t *context, - coap_event_t event, - coap_session_t *session); +typedef void (*coap_event_handler_t)(coap_session_t *session, + const coap_event_t event); ---- Events can be one of the following ----