You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
coap_get_id() performs a ntohs() on the coap_hdr_t.id attribute to return a value in host byte order.
However, coap_build_hdr() assumes the id parameter input already is in network order. Since it is a public function, I think the id parameter should be in host order, to reverse the effect of coap_get_id(). For example, the use of coap_build_hdr() in nanocoap_get() expects to store a message id of 1, but actually stores 256 (0x0100).
This change would require an update in coap_build_reply() to swap the byte order before passing to coap_build_hdr().