-
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
sys/net/nanocoap: introduce Accept option helper #18772
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JKRhb
requested review from
miri64,
haukepetersen,
PeterKietzmann and
cgundogan
as code owners
October 19, 2022 13:14
github-actions
bot
added
Area: CoAP
Area: Constrained Application Protocol implementations
Area: network
Area: Networking
Area: sys
Area: System
Area: tests
Area: tests and testing framework
labels
Oct 19, 2022
miri64
reviewed
Oct 19, 2022
miri64
reviewed
Oct 19, 2022
miri64
added
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
and removed
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Oct 19, 2022
Murdock results✔️ PASSED 61d1516 tests/nanocoap: add unit test for Accept option helper
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
miri64
requested changes
Oct 19, 2022
miri64
approved these changes
Oct 19, 2022
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.
Please squash!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: CoAP
Area: Constrained Application Protocol implementations
Area: network
Area: Networking
Area: sys
Area: System
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
Working with content negotiation in the context of gcoap/nanocoap, I noticed that it would be handy to be able to access the Accept option of a request more easily. Therefore, this PR adds a new helper function
coap_get_accept
that gets the respective option value from a CoAP packet. It reuses most of the code from the existingcoap_get_content_type
helper, moving its logic to a new internal function that is called by bothcoap_get_content_type
andcoap_get_accept
.Testing procedure
I adjusted the existing unit tests to assert that new the helper works.
Issues/PRs references
—