[riot-notifications] [RIOT-OS/RIOT] net/nanocoap: rework option handling (#8772)

Koen Zandberg notifications at github.com
Mon Apr 9 09:52:28 CEST 2018


bergzand requested changes on this pull request.



> + * @returns     the packet's content type value
+ */
+unsigned coap_get_content_type(coap_pkt_t *pkt);
+
+/**
+ * @brief    Get the packet's request URI
+ *
+ * This function decodes the pkt's URI option into a "/"-seperated and
+ * NULL-terminated string.
+ *
+ * Caller must ensure @p target can hold at least NANOCOAP_URI_MAX bytes!
+ *
+ * @param[in]   pkt     pkt to work on
+ * @param[out]  target  buffer for target URI
+ *
+ * @returns     -EBADMSG    if no URI option in packet

With the [comment](https://github.com/RIOT-OS/RIOT/pull/8772#discussion_r176366289) from @kb2ma resolved, this return error code is not valid anymore for the specified situation.

>  
     return 0;
 }
 
+uint8_t *coap_find_option(coap_pkt_t *pkt, unsigned opt_num)

Is there a reason for not marking the `coap_pkt_t *pkt` as `const` (`const coap_pkt_t *pkt`) here and in the other getters below?

-- 
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/8772#pullrequestreview-110350743
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20180409/6fa5102d/attachment.html>


More information about the notifications mailing list