我们可以从另一个模块调用一个模块的叶子设备直接方法吗?

问题描述

我已经开发了两个定制的IoT边缘模块 例如 Module1,Module2

Module1在容器内部运行着多个IoT设备(叶设备)。

这些叶子设备具有某些直接的书面方法,例如 IsDeviceOnline

是否可以从 Module2 调用该直接方法?

我尝试通过在如下所示的调用时编写叶子deviceId来尝试,但它给出了 {"status":500,"payload":null} 总是。

MethodRequest request = new MethodRequest("IsDeviceOnline");
var resp = await moduleclient.InvokeMethodAsync(deviceId,"Module1",request);

上面的代码正在从Module2执行

解决方法

我找到了解决方法...

我刚刚删除了moduleId,它运行正常

MethodRequest request = new MethodRequest("IsDeviceOnline");
         // Execute request
         var resp = await moduleclient.InvokeMethodAsync(deviceId,request);

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...