gpt4 book ai didi

Azure IoT边缘以编程方式[NodeJS]创建边缘和叶子设备之间的父子关系

转载 作者:行者123 更新时间:2023-12-03 05:34:05 25 4
gpt4 key购买 nike

我从 Azure GitHub 存储库中找到了链接,我们可以使用 Java 在边缘设备和叶设备之间创建父子关系。和 Python语言,但我没有在 Azure 提供的 NodeJS sdk 中找到该语言的 api/接口(interface)。有人在 NodeJS 中实现过这个吗?

最佳答案

根据REST APIdeviceScope 属性:

The scope of the device. Auto generated and immutable for edge devicesand modifiable in leaf devices to create child/parent relationship.

因此,请尝试在设备对象中提供此属性,例如here用于registry.create()

更新:所以这段代码可以工作:

  var device = {
deviceId: '<MY DEVICE ID>',
deviceScope: 'ms-azure-iot-edge://<MY EDGE DEVICE ID>-xxxxxxxx'
};

registry.update(device, printAndContinue('update', function next(){...});

您可以在边缘设备的设备孪生中找到其 deviceScope 的值:

enter image description here

更新

如果您想删除请求中设置的父/子关系 deviceScope: null

关于Azure IoT边缘以编程方式[NodeJS]创建边缘和叶子设备之间的父子关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63792034/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com