cazure-iot-hub

Azure IoT C SDK: IoTHubDeviceClient_LL_SendTelemetryAsync vs IoTHubDeviceClient_LL_SendEventAsync


I'm starting to work with the Azure IoT C SDK. Currently, I am experimenting with the different ways to transmit data between a device and the cloud.

What is the difference between IoTHubDeviceClient_LL_SendTelemetryAsync and IoTHubDeviceClient_LL_SendEventAsync?

The documentation doesn't really help as it doesn't state what the difference between telemetry data and an event is.

The log output looks the very same for both calls:

-> 08:14:54 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/Test1/messages/events/ | PACKET_ID: 5 | PAYLOAD_LEN: 9
-> 08:14:54 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/Test1/messages/events/ | PACKET_ID: 6 | PAYLOAD_LEN: 9

A google search doesn't turn up any information either.


Solution

  • IoTHubDeviceClient_LL_SendTelemetryAsync is simply an alias for IoTHubDeviceClient_LL_SendEventAsync. They do the same thing. See the code here:

    https://github.com/Azure/azure-iot-sdk-c/blob/59b7663bb329b64103bb0f22d95162087c01037c/iothub_client/src/iothub_device_client_ll.c#L171