riot_sys

Function coap_pkt_init

Source
pub unsafe extern "C" fn coap_pkt_init(
    pkt: *mut coap_pkt_t,
    buf: *mut u8,
    len: size_t,
    header_len: size_t,
)
Expand description

@brief Initialize a packet struct, to build a message buffer

@pre buf CoAP header already initialized @post pkt.flags all zeroed @post pkt.payload points to first byte after header @post pkt.payload_len set to maximum space available for options + payload

@param[out] pkt pkt to initialize @param[in] buf buffer to write for pkt, with CoAP header already initialized @param[in] len length of buf @param[in] header_len length of header in buf, including token