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:
parent
3b7c1254d3
commit
b9d7028a8f
@ -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
|
||||
* @{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user