Skip to content

Commit

Permalink
Merge pull request #20499 from benpicco/coap_build_hdr-const
Browse files Browse the repository at this point in the history
nanocoap: allow token to be const in coap_build_hdr()
  • Loading branch information
maribu authored Mar 22, 2024
2 parents e2a2c42 + 6154c12 commit 3d13f1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sys/include/net/nanocoap.h
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ ssize_t coap_block2_build_reply(coap_pkt_t *pkt, unsigned code,
*
* @returns length of resulting header
*/
ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, uint8_t *token,
ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, const void *token,
size_t token_len, unsigned code, uint16_t id);

/**
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/nanocoap/nanocoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ ssize_t coap_build_reply(coap_pkt_t *pkt, unsigned code,
return len;
}

ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, uint8_t *token,
ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, const void *token,
size_t token_len, unsigned code, uint16_t id)
{
assert(!(type & ~0x3));
Expand Down

0 comments on commit 3d13f1f

Please sign in to comment.