openthread_sys

Function otCoapMessageAppendContentFormatOption

Source
pub unsafe extern "C" fn otCoapMessageAppendContentFormatOption(
    aMessage: *mut otMessage,
    aContentFormat: otCoapOptionContentFormat,
) -> otError
Expand description

Appends the Content Format CoAP option as specified in https://tools.ietf.org/html/rfc7252#page-92. This must be called before setting otCoapMessageSetPayloadMarker if a payload is to be included in the message.

The function is a convenience wrapper around otCoapMessageAppendUintOption, and if the desired format type code isn’t listed in otCoapOptionContentFormat, this base function should be used instead.

@param[in,out] aMessage A pointer to the CoAP message. @param[in] aContentFormat One of the content formats listed in otCoapOptionContentFormat above.

@retval OT_ERROR_NONE Successfully appended the option. @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type. @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.