Skip to content

Commit

Permalink
fixup! add warning to gcoap_finish() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kb2ma committed Oct 23, 2018
1 parent df9e6dc commit 71c0269
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sys/include/net/gcoap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71c0269

Please sign in to comment.