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