IoTHubModuleClient_LL_SendMessageDisposition

Function IoTHubModuleClient_LL_SendMessageDisposition 

Source
pub unsafe extern "C" fn IoTHubModuleClient_LL_SendMessageDisposition(
    module_ll_handle: IOTHUB_MODULE_CLIENT_LL_HANDLE,
    message: IOTHUB_MESSAGE_HANDLE,
    disposition: IOTHUBMESSAGE_DISPOSITION_RESULT,
) -> IOTHUB_CLIENT_RESULT
Expand description

@brief This API sends an acknowledgement to Azure IoT Hub that a cloud-to-device message has been received and frees resources associated with the message.

@param module_ll_handle The handle created by a call to a create function. @param message The cloud-to-device message received through the callback provided to IoTHubModuleClient_LL_SetMessageCallback or IoTHubModuleClient_LL_SetInputMessageCallback. @param disposition Acknowledgement option for the message.

@warning This function is to be used only when IOTHUBMESSAGE_ASYNC_ACK is used in the callback for incoming cloud-to-device messages. @remarks If your cloud-to-device message callback returned IOTHUBMESSAGE_ASYNC_ACK, it MUST call this API eventually. Beyond sending acknowledgment to the service, this method also handles freeing message’s memory. Not calling this function will result in memory leaks. Depending on the protocol used, this API will acknowledge cloud-to-device messages differently: AMQP: A MESSAGE DISPOSITION is sent using the disposition option provided. MQTT: A PUBACK is sent if disposition is IOTHUBMESSAGE_ACCEPTED. Passing any other option results in no PUBACK sent for the message. HTTP: A HTTP request is sent using the disposition option provided.

@return IOTHUB_CLIENT_OK upon success, or an error code upon failure.