nanocoap: export coap_opt_get_uint()#13893
Conversation
benpicco
left a comment
There was a problem hiding this comment.
Pretty straightforward, matches coap_opt_get_string()
1614bc0 to
cd954a3
Compare
|
@benpicco thanks for the quick feedback. I changed the parameter from |
046fb9f to
048bec5
Compare
kb2ma
left a comment
There was a problem hiding this comment.
Reasonable to expose this function, and the name fits with the API.
sys/include/net/nanocoap.h
Outdated
| * @param[out] value the parsed option value | ||
| * | ||
| * @return 0 if the option was found and the value was parsed correctly | ||
| * @return -1 if the option was not found in @p pkt |
There was a problem hiding this comment.
Return -ENOENT if not found to be consistent with coap_opt_get_opaque() and coap_opt_get_next(). Go ahead and squash this in here and in nanocoap.c.
There was a problem hiding this comment.
Alright, that is a good hint. I also added -ENOSPC to the docs .. did overlook that one over in nanocoap.c::coap_opt_get_uint().
I amended the changes immediately into the commit.
048bec5 to
b38a54d
Compare
b38a54d to
6859de7
Compare
|
ACK. Tested with gcoap observe. |
Contribution description
This PR exports the
coap_opt_get_uint()function (similar to the already existing publiccoap_opt_add_uint()function). Currently, it is a hidden function innanocoap.c.Testing procedure
--
Issues/PRs references
This PR is a cut-out of #13889 since it is unrelated to the actual cache implementation.