net: coap: define default CoAP version
RFC 7252 (CoAP) specifies value of the Version (Ver) field in the protocol header to value 1. This patch defines value of the Version field to make packet initialization easier. All samples and tests are updated to use the new COAP_VERSION_1 field when initializing a CoAP packet. Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
This commit is contained in:
parent
4431ae5119
commit
22687c34e3
8 changed files with 55 additions and 37 deletions
|
@ -940,7 +940,8 @@ int lwm2m_init_message(struct lwm2m_message *msg)
|
|||
}
|
||||
|
||||
r = coap_packet_init(&msg->cpkt, msg->msg_data, sizeof(msg->msg_data),
|
||||
1, msg->type, tokenlen, token, msg->code, msg->mid);
|
||||
COAP_VERSION_1, msg->type, tokenlen, token,
|
||||
msg->code, msg->mid);
|
||||
if (r < 0) {
|
||||
LOG_ERR("coap packet init error (err:%d)", r);
|
||||
goto cleanup;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue