question

JustinPham-4634 avatar image
0 Votes"
JustinPham-4634 asked asergaz commented

Azure IoT Device Twin Querying in the C SDK

I was looking into implementing group messaging to devices on a Azure IoT Hub in the C SDK by querying device twin information. In the other SDKs the registrymanager class generally handles these tasks. Unfortunately I was unable to find any documentation for the class even though it seems to still exist in the SDK. Does anyone have documentation for this class or has implemented this feature before and has tips on its implementation with the C SDK.

azure-iot-hubazure-iot-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

asergaz avatar image
0 Votes"
asergaz answered asergaz commented

Hello @JustinPham-4634 ,

Sending Cloud to Device Messages or Direct Methods to Devices registered with Azure IoT Hub is achieved by using Azure IoT Hub **Service** SDKs. The supported platforms are .NET, Java, Node, Python. We don't have an Azure IoT Service SDK written in C.

You can know more about Azure IoT Hub SDKs here. Learn more about the IoT Hub Device SDKS in the IoT Device Development Documentation.

I hope I could help and happy coding :)!

Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
- Want a reminder to come back and check responses? Here is how to subscribe to a notification.




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Technically a service SDK does exist for C. I think they discontinued ongoing support for new features, but it still gets updates. If you check the SDK repository you'll find it there. Documentation used to exist for it but it appears to have been removed. Since it will still be updated regardless of whether or not it gets new features, I wanted to know if it had the capability to query the IoT Hub which is difficult to say without documentation.

1 Vote 1 ·
asergaz avatar image asergaz JustinPham-4634 ·

@JustinPham-4634 you are absolutely right. Service SDK was supported before: https://github.com/Azure/azure-iot-sdk-c/tree/main/iothub_service_client

It is now deprecated and as written in the github repo: "We will continue to fix critical bugs such as crashes, data corruption, and security vulnerabilities. We will NOT add any new feature or fix bugs that are not critical, however."

I looked at the Long Term Support Branhces and noticed that the github branch lts_07_2021 still have the devdocs in it :). It will be supported until August 2022.

See: https://github.com/Azure/azure-iot-sdk-c/blob/lts_07_2021/iothub_service_client/devdoc/requirement_docs/iothubserviceclient_devicetwin_requirements.md

To your need you will need to leverage IoTHubDeviceTwin : "IoTHubDeviceTwin allows retrieve tags and properties, update tags and desired state and receive twin notificatons."

Let me know If I was able to help?
Thanks a lot!




0 Votes 0 ·