本文介绍:
1. Azure IoT edge 从云到边缘设备的控制方式之一 direct method。
2. Edge-agent中内置的 direct method
本文参考:https://docs.microsoft.com/zh-cn/azure/iot-edge/how-to-edgeagent-direct-method
视频:
https://www.51azure.cloud/post/2020/11/14/azure-iot-edge9azure-iot-edge-module-direct-method
图文:
我们之前介绍过Azure IoT Hub 的云到设备控制的方法之一是direct method,参见《云到设备的控制-direct method》。
与此类似,Azure IoT Edge Module中也支持direct method,可以实现对在线module的控制及数据传输(通过payload)。
同时,Azure IoT Edge的系统Module之一的Edge-agent中也内置了几个direct method。
direct metod 功能通过 Module client 提供,各个语言的Module client 语法, 请参阅首选 SDK 语言的 API 参考:C#、C、Python、Java 或 Node.js。
例如C#语言的 direct method 相关的方法:
ModuleClient.SetMessageHandlerAsync Method
Definition
Overloads
SetMessageHandlerAsync(MessageHandler, Object) |
Sets a new default delegate which applies to all endpoints. If a delegate is already associated with the input, it will be called, else the default delegate will be called. If a default delegate was set previously, it will be overwritten. |
SetMessageHandlerAsync(MessageHandler, Object, CancellationToken) |
Sets a new default delegate which applies to all endpoints. If a delegate is already associated with the input, it will be called, else the default delegate will be called. If a default delegate was set previously, it will be overwritten. |


PING


RestartModule



诊断相关的直接方法:
- GetModuleLogs:在直接方法的响应中检索内联模块日志。
- UploadModuleLogs:检索模块日志,并将其上传到 Azure Blob 存储。
- UploadSupportBundle:使用支持捆绑检索模块日志,并将 zip 文件上传到 Azure Blob 存储。
- GetTaskStatus:检查上传日志或支持捆绑请求的状态。
注意,IoT Edge Runtime 1.0.10 版本提供这些诊断直接方法。
点击可查阅本站文章目录 《文章分类目录》
本站所有内容仅代表个人观点,如与官文档冲突,请以官方文档为准。
可在本页面下方留言或通过下方联系方式联系我:
微信:wxyusz;邮箱:shuzhen.yu@foxmail.com
欢迎关注公众号“云计算实战”,接收最新文章推送。
本作品由Sean Yu 采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
欢迎转载、使用、重新发布,但务必保留文章链接:https://www.51azure.cloud,且不得用于商业目的。