Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.66 KB

iothubmoduleclient-setmessagecallback.md

File metadata and controls

40 lines (30 loc) · 1.66 KB
title titleSuffix description manager author ms.author ms.date ms.service ms.custom ms.topic
IoTHubModuleClient_SetMessageCallback function reference | Microsoft Docs
Azure IoT C SDK
This is the function reference page for the IoTHubModuleClient_SetMessageCallback() function in the Azure IoT C SDK. This SDK is used with Azure IoT Hub and Azure IoT Hub Device Provisioning Service
timlt
wesmc7777
wesmc
03/25/2022
iot-hub
reference

IoTHubModuleClient_SetMessageCallback()

Sets up the message callback to be invoked when IoT Hub issues a message to the device. This is a blocking call.

Syntax

#include "azure-iot-sdk-c/iothub_client/inc/iothub_module_client.h"

IOTHUB_CLIENT_RESULT IoTHubModuleClient_SetMessageCallback(
  IOTHUB_MODULE_CLIENT_HANDLE           iotHubModuleClientHandle,
  IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC  messageCallback,
  void *                                userContextCallback
);

Parameters

  • iotHubModuleClientHandle The handle created by a call to the create function.

  • messageCallback The callback specified by the device for receiving messages from IoT Hub.

  • userContextCallback User specified context that will be provided to the callback. This can be NULL.

: Do not call IoTHubModuleClient_Destroy() from inside your application's callback.

Return Value

IOTHUB_CLIENT_OK upon success or an error code upon failure.