Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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");
         // Execute request
         var resp = await moduleclient.InvokeMethodAsync(deviceId, "Module1", request);


Above code is geeting executed from Module2

What I have tried:

I have explored many things over google and IoT forums but I am not sure if it is possible even.
Posted
Updated 20-Aug-20 2:39am
v5

1 solution

I got the solution...

I have just removed moduleId and it is working fine

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


Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900