openthread_sys

Function otCoapSendRequestWithParameters

Source
pub unsafe extern "C" fn otCoapSendRequestWithParameters(
    aInstance: *mut otInstance,
    aMessage: *mut otMessage,
    aMessageInfo: *const otMessageInfo,
    aHandler: otCoapResponseHandler,
    aContext: *mut c_void,
    aTxParameters: *const otCoapTxParameters,
) -> otError
Expand description

Sends a CoAP request with custom transmission parameters.

If a response for a request is expected, respective function and context information should be provided. If no response is expected, these arguments should be NULL pointers.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aMessage A pointer to the message to send. @param[in] aMessageInfo A pointer to the message info associated with @p aMessage. @param[in] aHandler A function pointer that shall be called on response reception or timeout. @param[in] aContext A pointer to arbitrary context information. May be NULL if not used. @param[in] aTxParameters A pointer to transmission parameters for this request. Use NULL for defaults. Otherwise, parameters given must meet the following conditions: 1. mMaxRetransmit is no more than OT_COAP_MAX_RETRANSMIT. 2. mAckRandomFactorNumerator / mAckRandomFactorDenominator must not be below 1.0. 3. The calculated exchange life time must not overflow uint32_t.

@retval OT_ERROR_NONE Successfully sent CoAP message. @retval OT_ERROR_NO_BUFS Failed to allocate retransmission data. @retval OT_ERROR_INVALID_ARGS Invalid arguments are given.