[riot-notifications] [RIOT-OS/RIOT] nanocoap: change method flag type to uint32_t (#10214)

Marian Buschsieweke notifications at github.com
Tue Feb 26 21:45:22 CET 2019


maribu commented on this pull request.



> @@ -250,7 +250,7 @@ typedef ssize_t (*coap_handler_t)(coap_pkt_t *pkt, uint8_t *buf, size_t len, voi
  */
 typedef struct {
     const char *path;               /**< URI path of resource               */
-    unsigned methods;               /**< OR'ed methods this resource allows */
+    uint32_t methods;               /**< OR'ed methods this resource allows */

So far 7 methods are officially standardized, see [IANA entry](https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#method-codes). (`GET`, `POST`, `PUT`, and `DELETE` are introduced by [RFC  7252](https://tools.ietf.org/html/rfc7252), `FETCH`, `PATCH` and `iPATCH` were added in [RFC 8132](https://tools.ietf.org/html/rfc8132).) So *for* *now* `uint8_t` would be enough. Keeping in mind that there is now way to have more than 31 methods, `uint32_t` would be completely future proof.

But honestly: CoAP is intended for constrained devices. The addition of new methods is hopefully done with care and only for very good reason. I personally think that `uint16_t` should be enough for quite some time.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10214#discussion_r260478980
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190226/5df8c4e8/attachment.html>


More information about the notifications mailing list