I got the solution...
I have just removed moduleId and it is working fine
MethodRequest request = new MethodRequest("IsDeviceOnline");
// Execute request
var resp = await moduleclient.InvokeMethodAsync(deviceId, request);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have developed two custom IoT edge modules
e.g. Module1, Module2
Module1 is having multiple IoT devices (Leaf devices) running inside the container.
Those leaf devices have certain direct methods written e.g. IsDeviceOnline
Is it possible to invoke that direct method from Module2?
I have tried by writing leaf deviceId while invoking as below but it gives
{"status":500,"payload":null}
always.
MethodRequest request = new MethodRequest("IsDeviceOnline");
var resp = await moduleclient.InvokeMethodAsync(deviceId, "Module1", request);
Above code is getting executed from Module2
I got the solution...
I have just removed moduleId and it is working fine
MethodRequest request = new MethodRequest("IsDeviceOnline");
// Execute request
var resp = await moduleclient.InvokeMethodAsync(deviceId, request);