August 2017
Intermediate to advanced
254 pages
6h 10m
English
In this topic, we are going to create a C# simulator, which will use the device twin and direct methods to send the firmware update to device:
client = ServiceClient.CreateFromConnectionString(AzureIoTHub.GetConnectionString());CloudToDeviceMethod method = new CloudToDeviceMethod("firmwareUpdate");method.ResponseTimeout = TimeSpan.FromSeconds(30);method.SetPayloadJson(@"{fwPackageUri : '"+ bloburl + "'}");CloudToDeviceMethodResult result = await client.InvokeDeviceMethodAsync(targetDevice, method);