From d52986f0045949cd37a630349d4e787ae2560550 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Wed, 30 Jun 2021 11:42:19 +0100 Subject: [PATCH] coap_resource_init: Leading '/' is not required for uri_path Remind users in the documentation that the full path defining the resource in the uri_path parameter does not normally need a leading '/'. E.g. It should be "full/path/for/resource", not "/full/path/for/resource". --- include/coap3/resource.h | 3 ++- man/coap_resource.txt.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/coap3/resource.h b/include/coap3/resource.h index 2cd9aea4..5cf7751f 100644 --- a/include/coap3/resource.h +++ b/include/coap3/resource.h @@ -83,7 +83,8 @@ typedef void (*coap_method_handler_t) * variable of coap_str_const_t has to point to constant text, or point to data * within the allocated coap_str_const_t parameter. * - * @param uri_path The string URI path of the new resource. + * @param uri_path The string URI path of the new resource. The leading '/' is + * not normally required - e.g. just "full/path/for/resource". * @param flags Flags for memory management (in particular release of * memory). Possible values:@n * diff --git a/man/coap_resource.txt.in b/man/coap_resource.txt.in index 8d855d49..5d497b36 100644 --- a/man/coap_resource.txt.in +++ b/man/coap_resource.txt.in @@ -91,7 +91,8 @@ handle matching the URI which then can be Observable. The *coap_resource_init*() function returns a newly created _resource_ of type _coap_resource_t_ * . _uri_path_ specifies the uri string path to match -against. _flags_ is used to define whether the +against. Normally there is no need for the leading '/' - e.g. just +"full/path/for/resource". _flags_ is used to define whether the _resource_ is of type Confirmable Message or Non-Confirmable Message for any "observe" responses. See *coap_observe*(3). _flags_ can be one of the following definitions or'ed together.