在Swift SDK中获得Device Twin -Azure IoT中心

发布于 2025-02-01 05:48:53 字数 360 浏览 3 评论 0原文

有没有一种方法可以使用azure sdk从Azure Iot-Hub中获取设备的Twin Twin?

据我所知,我能够使用nodejs的Azure SDK来获得设备的双胞胎,也可以使用C和其他设备。

In the documentation it says that the swift sdk is a part of the C sdk. But i didnt know how to get the device twin into swift. I tested with the given code example in the docs but its only how to send messages to the device.

Is there a way to get the device twin of a device from Azure IoT-Hub, using Azure SDK for Swift?

As far as I know, I am able to get the device twin using the Azure SDK for NodeJS and also its possible for C and others.

In the documentation it says that the swift sdk is a part of the C sdk. But i didnt know how to get the device twin into swift. I tested with the given code example in the docs but its only how to send messages to the device.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千紇 2025-02-08 05:48:53

是否有一种方法可以从Azure Iot-Hub中获取设备双胞胎,并使用Azure SDK进行Swift?

根据此开放,问题,到目前为止,到目前为止, iothubdevicetwin_gettwin使用azure SDK用于Swift,没有可用的示例。

另外,如罗马,您可以使用 REST API

GET https://fully-qualified-iothubname.azure-devices.net/twins/{id}?api-version=2020-05-31-preview

对于Swift,您可以使用 asynchttpclient 1.6.4.4 https://learn.microsoft.com/en-us/azure/ozure/iot-hub/iot-hub-dev-guide-sas?tabs=node“ rel =“ nofollow noreferrer”> sas token 用于授权标题并使用

Is there a way to get the device twin of a device from Azure IoT-Hub, using Azure SDK for Swift?

As per this open issue, as of now, there is no sample available for IoTHubDeviceTwin_GetTwin using Azure SDK for Swift.

Alternatively, as suggested by Roman, you can get the device twin using REST API.

GET https://fully-qualified-iothubname.azure-devices.net/twins/{id}?api-version=2020-05-31-preview

For Swift, you can use AsyncHttpClient 1.6.4, SAS token for authorization header and create it using Device Explorer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文