diff --git a/sys/include/net/gcoap.h b/sys/include/net/gcoap.h index e91748d11e02959a62f6d8d27eb884bbcdd8f7a8..bd475c74c0711887ccc43a8083e0dd9684c1e1b8 100644 --- a/sys/include/net/gcoap.h +++ b/sys/include/net/gcoap.h @@ -472,8 +472,9 @@ static inline ssize_t gcoap_request(coap_pkt_t *pdu, uint8_t *buf, size_t len, * @return length of the packet * @return 0 if cannot send */ -size_t gcoap_req_send2(uint8_t *buf, size_t len, sock_udp_ep_t *remote, - gcoap_resp_handler_t resp_handler); +size_t gcoap_req_send2(const uint8_t *buf, size_t len, + const sock_udp_ep_t *remote, + gcoap_resp_handler_t resp_handler); /** * @brief Sends a buffer containing a CoAP request to the provided host/port. @@ -489,8 +490,8 @@ size_t gcoap_req_send2(uint8_t *buf, size_t len, sock_udp_ep_t *remote, * @return length of the packet * @return 0 if cannot send */ -size_t gcoap_req_send(uint8_t *buf, size_t len, ipv6_addr_t *addr, uint16_t port, - gcoap_resp_handler_t resp_handler); +size_t gcoap_req_send(const uint8_t *buf, size_t len, const ipv6_addr_t *addr, + uint16_t port, gcoap_resp_handler_t resp_handler); /** * @brief Initializes a CoAP response packet on a buffer. @@ -557,7 +558,8 @@ int gcoap_obs_init(coap_pkt_t *pdu, uint8_t *buf, size_t len, * @return length of the packet * @return 0 if cannot send */ -size_t gcoap_obs_send(uint8_t *buf, size_t len, const coap_resource_t *resource); +size_t gcoap_obs_send(const uint8_t *buf, size_t len, + const coap_resource_t *resource); /** * @brief Provides important operational statistics. diff --git a/sys/net/application_layer/coap/gcoap.c b/sys/net/application_layer/coap/gcoap.c index 3e518bc5d4e1e214afb7058c360f2003ea627d6b..d441820f9d3a6ccdc3e3af3646b80c9d365b59fc 100644 --- a/sys/net/application_layer/coap/gcoap.c +++ b/sys/net/application_layer/coap/gcoap.c @@ -661,8 +661,8 @@ ssize_t gcoap_finish(coap_pkt_t *pdu, size_t payload_len, unsigned format) return _finish_pdu(pdu, (uint8_t *)pdu->hdr, len); } -size_t gcoap_req_send(uint8_t *buf, size_t len, ipv6_addr_t *addr, uint16_t port, - gcoap_resp_handler_t resp_handler) +size_t gcoap_req_send(const uint8_t *buf, size_t len, const ipv6_addr_t *addr, + uint16_t port, gcoap_resp_handler_t resp_handler) { sock_udp_ep_t remote; @@ -675,8 +675,9 @@ size_t gcoap_req_send(uint8_t *buf, size_t len, ipv6_addr_t *addr, uint16_t port return gcoap_req_send2(buf, len, &remote, resp_handler); } -size_t gcoap_req_send2(uint8_t *buf, size_t len, sock_udp_ep_t *remote, - gcoap_resp_handler_t resp_handler) +size_t gcoap_req_send2(const uint8_t *buf, size_t len, + const sock_udp_ep_t *remote, + gcoap_resp_handler_t resp_handler) { gcoap_request_memo_t *memo = NULL; assert(remote != NULL); @@ -775,7 +776,8 @@ int gcoap_obs_init(coap_pkt_t *pdu, uint8_t *buf, size_t len, } } -size_t gcoap_obs_send(uint8_t *buf, size_t len, const coap_resource_t *resource) +size_t gcoap_obs_send(const uint8_t *buf, size_t len, + const coap_resource_t *resource) { gcoap_observe_memo_t *memo = NULL;