1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

coap: provide definition for version field value

This commit is contained in:
Martine Lenders 2022-09-29 11:26:03 +02:00
parent 3b7c1254d3
commit b9d7028a8f
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80
2 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,8 @@ extern "C" {
*/
#define COAP_PORT (5683)
#define COAP_V1 (1) /**< Identifier for CoAP version 1 (RFC 7252) */
/**
* @name CoAP option numbers
* @{

View File

@ -529,7 +529,7 @@ ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, uint8_t *token, size_t to
assert(!(token_len & ~0x1f));
memset(hdr, 0, sizeof(coap_hdr_t));
hdr->ver_t_tkl = (0x1 << 6) | (type << 4) | token_len;
hdr->ver_t_tkl = (COAP_V1 << 6) | (type << 4) | token_len;
hdr->code = code;
hdr->id = htons(id);