官术网_书友最值得收藏!

How to do it...

In this section, we will create a device job to update the device twin properties:

  1. We will create a job to update device twin properties:
var twin = new Twin();
twin.Properties.Desired["HighTemperature"] = "44";
twin.Properties.Desired["City"] = "Mumbai";
twin.ETag = "*";

return await jobClient.ScheduleTwinUpdateAsync(jobId,
"deviceId='"+ deviceId + "'",
twin,
DateTime.Now,
10);
  1. We will use following code to get the device job status, which was initiated in step 1:
JobClient jobClient;
JobClient jobClient;jobClient = JobClient.CreateFromConnectionString(abc.GetConnectionString());

public async Task<JobResponse> MonitorJob(string jobId, JobClient jobClient)
{
return await jobClient.GetJobAsync(jobId);
}
主站蜘蛛池模板: 新巴尔虎右旗| 连南| 佛学| 宜君县| 龙里县| 嘉鱼县| 永丰县| 济阳县| 普陀区| 新营市| 上饶县| 灌南县| 红桥区| 沅江市| 科技| 江西省| 桃园县| 青阳县| 潼南县| 清河县| 新泰市| 荃湾区| 义乌市| 屏山县| 锡林郭勒盟| 胶南市| 邢台县| 扶沟县| 牙克石市| 湄潭县| 会理县| 三河市| 新泰市| 邵阳市| 厦门市| 滨州市| 禹城市| 玉环县| 洛浦县| 萝北县| 木里|