-
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
nanocoap: Add handler for resource-based subtrees #13698
nanocoap: Add handler for resource-based subtrees #13698
Conversation
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.
This PR looks like a step toward a concept like gcoap_listener_t
. Eventually it will make sense to add more metadata to a coap_subtree_handler_t, and to use it in place of the externs for coap_resources and coap_resources_numof.
I created #11488 to move this sort of application level functionality to nanocoap sock to avoid duplication and confusion with gcoap. The contents of the current PR are similar to #11436 from last year that was closed partly due to these concerns.
As this coap_subtree_handler_t matures and we find commonality between nanocoap sock and gcoap, we can move the common bits into nanocoap itself. Maybe we can at least move coap_handle_req()
and its components to nanocoap sock for now.
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.
Only moves code from SUIT into the common domain.
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.
I would appreciate a response to my concerns before merging.
@bergzand can you add the response requested by Ken? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
This is still a valid cleanup. Please rebase. |
@bergzand ping |
This adds a coap_handler_t function that can be used to parse new subtrees. The subtree information is included in the context pointer of the call and must be of type coap_resource_subtree_t. This object then contains the pointer and length of a different coap_resource_t instance.
The SUIT CoAP code can make use of the generic subtree handler. This commit removes the obsolete code to make use of the more generic nanocoap subtree handlers.
d298073
to
677871d
Compare
Contribution description
This adds a coap_handler_t function that can be used to parse new
subtrees. The subtree information is included in the context pointer of
the call and must be of type coap_resource_subtree_t. This object then
contains the pointer and length of a different coap_resource_t instance.
Testing procedure
The coap handlers in
examples/suit-update
should still work as beforeIssues/PRs references
Follow-up with more cleanups to #13687