From 21cba5771d579c9c352c635fdedf89eb623de8a8 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 30 Mar 2022 22:40:33 +0200 Subject: [PATCH] nanocoap: constify helper functions --- sys/include/net/nanocoap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/include/net/nanocoap.h b/sys/include/net/nanocoap.h index 88266dc424..91a57f1269 100644 --- a/sys/include/net/nanocoap.h +++ b/sys/include/net/nanocoap.h @@ -324,7 +324,7 @@ static inline uint8_t coap_code(unsigned cls, unsigned detail) * * @returns message code class */ -static inline unsigned coap_get_code_class(coap_pkt_t *pkt) +static inline unsigned coap_get_code_class(const coap_pkt_t *pkt) { return pkt->hdr->code >> 5; } @@ -348,7 +348,7 @@ static inline unsigned coap_get_code_detail(const coap_pkt_t *pkt) * * @returns message code in decimal format */ -static inline unsigned coap_get_code(coap_pkt_t *pkt) +static inline unsigned coap_get_code(const coap_pkt_t *pkt) { return (coap_get_code_class(pkt) * 100) + coap_get_code_detail(pkt); }