From 71c02691bf13e0263b07a92c457472fb6032eea9 Mon Sep 17 00:00:00 2001 From: Ken Bannister Date: Tue, 23 Oct 2018 13:09:38 -0400 Subject: [PATCH] fixup! add warning to gcoap_finish() documentation --- sys/include/net/gcoap.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/include/net/gcoap.h b/sys/include/net/gcoap.h index 87e6209a3e34..f84d673b0c4b 100644 --- a/sys/include/net/gcoap.h +++ b/sys/include/net/gcoap.h @@ -527,8 +527,14 @@ int gcoap_req_init(coap_pkt_t *pdu, uint8_t *buf, size_t len, /** * @brief Finishes formatting a CoAP PDU after the payload has been written * - * Assumes the PDU has been initialized with gcoap_req_init() or - * gcoap_resp_init(). + * Assumes the PDU has been initialized with a gcoap_xxx_init() function, like + * gcoap_req_init(). + * + * @warning To use this function, you only may have added an Option with + * option number less than COAP_OPT_CONTENT_FORMAT. Otherwise, use the + * struct-based API described with @link net_nanocoap nanocoap. @endlink With + * this API, you specify the format with coap_opt_add_uint(), prepare for the + * payload with coap_opt_finish(), and then write the payload. * * @param[in,out] pdu Request metadata * @param[in] payload_len Length of the payload, or 0 if none