[riot-notifications] [RIOT-OS/RIOT] [RFC] gcoap adaptation to #8772 (#8831)

Ken Bannister notifications at github.com
Fri Apr 13 18:34:16 CEST 2018


Cool, thanks for the confirmation. Yes, option positions are stored in the coap_optpos_t array. The option values are actually stored in the packet buffer as a scratchpad as the user adds them. gcoap also maintains the payload pointer while building the options, so the user can copy that after specifying the last option. Then when the packet is finalized in the gcoap_finish() call, gcoap uses the coap_optpos_t array and the raw options in the packet buffer to write the real CoAP  options in the proper order to a stack-allocated buffer. Finally the stack buffer contents are copied back to the packet buffer, ready to send.

gcoap makes the trade-off of the stack buffer and extra memcpy for a simpler interface to the user.

I have started on the implementation for a request, and plan to have a WIP PR as soon as possible.

-- 
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/issues/8831#issuecomment-381191278
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20180413/a468e1af/attachment.html>


More information about the notifications mailing list