use of com.microsoft.azure.sdk.iot.service.Device in project azure-iot-sdk-java by Azure.
the class DeviceManagerSample method GetDevice.
private static void GetDevice() throws Exception {
RegistryManager registryManager = RegistryManager.createFromConnectionString(SampleUtils.iotHubConnectionString);
Device returnDevice = null;
try {
returnDevice = registryManager.getDevice(SampleUtils.deviceId);
System.out.println("Device: " + returnDevice.getDeviceId());
System.out.println("Device primary key: " + returnDevice.getPrimaryKey());
System.out.println("Device secondary key: " + returnDevice.getSecondaryKey());
System.out.println("Device eTag: " + returnDevice.geteTag());
} catch (IotHubException iote) {
iote.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations