-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/nanocoap: get option bytes #12075
Conversation
please rebase, #12074 is merged |
d1be6e6
to
4ace366
Compare
Rebased and engaged CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, nice addition
As a replacement for the coap_opt_get_next construction from a pointer, I suggest we add an option iteration initializer that'd work from coap_find_option. Thus, single options would be accessed using this |
Provides the ability to retrieve the value for an option as an opaque array of the bytes for the option. It is useful for an option with an opaque (byte array) data type. It also is useful to access any option as a byte array. For example, it can be convenient to replace the
more
attribute for a block option after it has been written to the packet.In future PRs we plan to refactor the implementation of the internal
coap_get_option_uint()
to usecoap_opt_get_opaque()
, rename it tocoap_opt_get_uint()
and make it public. We also plan to refactorcoap_get_blockopt()
to usecoap_opt_get_opaque()
.Testing procedure
Added to the tests-nanocoap unit tests.
Issues/PRs references
Depends on #12074. Partially replaces #11437.