Search in sources :

Example 11 with MethodResult

use of com.microsoft.azure.sdk.iot.device.edge.MethodResult in project azure-iot-sdk-java by Azure.

the class ModuleInvokeMethodSample method invokeMethodOnDevice.

private static MethodResult invokeMethodOnDevice(String methodName, String deviceIdToInvokeOn, ModuleClient client, MethodRequest methodRequest) throws ModuleClientException, URISyntaxException, IOException {
    System.out.println("Invoking method \"" + methodName + "\" on device \"" + deviceIdToInvokeOn + "\"");
    MethodResult result = client.invokeMethod(deviceIdToInvokeOn, methodRequest);
    System.out.println("Finished Invoking method \"" + methodName + "\" on device \"" + deviceIdToInvokeOn + "\"");
    return result;
}
Also used : MethodResult(com.microsoft.azure.sdk.iot.device.edge.MethodResult)

Aggregations

MethodResult (com.microsoft.azure.sdk.iot.device.edge.MethodResult)11 Test (org.junit.Test)5 HttpsTransportManager (com.microsoft.azure.sdk.iot.device.transport.https.HttpsTransportManager)4 MethodRequest (com.microsoft.azure.sdk.iot.device.edge.MethodRequest)3 ModuleClientException (com.microsoft.azure.sdk.iot.device.exceptions.ModuleClientException)3 IotHubTransportMessage (com.microsoft.azure.sdk.iot.device.transport.IotHubTransportMessage)3 MainApiException (io.swagger.server.api.MainApiException)2 JsonObject (io.vertx.core.json.JsonObject)2 HashMap (java.util.HashMap)1