[riot-notifications] [RIOT-OS/RIOT] sys/net/application_layer/nanocoap: Add path prefix option (#11098)

Kaspar Schleiser notifications at github.com
Tue Mar 5 12:31:04 CET 2019

> would you please give an example so I'm sure I understand what you mean.

This is not really related to the PR, but consider this:

coap_handler_t coap_subtree_handler(pkt, ..., context) {
coap_resource_t *subtree = (coap_resource_t *)context;
handler = find_handler(subtree, ...);
return handler(pkt, ...);

coap_resource_t saul_resources[] {
 { "/saul/info", COAP_METHOD_GET, saul_info_handler }

coap_resource_t resources[] = {
 { "/saul/", COAP_SUBTREE_MATCH | COAP_METHOD_ALL, coap_subtree_handler, saul_resources };

If done correctly, subtrees should be arbitrarily matchable. I hope this might improve code organization (if, e.g., the saul resource list is defined in saul.c).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190305/87b83344/attachment.html>

More information about the notifications mailing list