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

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);
}
主站蜘蛛池模板: 乐都县| 南华县| 和田县| 墨江| 苏尼特左旗| 会东县| 甘洛县| 黔南| 太仆寺旗| 上栗县| 和平区| 且末县| 密云县| 洞口县| 竹山县| 宿松县| 鸡西市| 沽源县| 浑源县| 台中县| 贵南县| 缙云县| 云林县| 昌都县| 柳林县| 布拖县| 黔西| 大荔县| 鲁山县| 花莲县| 霍林郭勒市| 万盛区| 嘉荫县| 渭源县| 晋江市| SHOW| 宿迁市| 丹凤县| 辉县市| 横峰县| 德庆县|