- Azure IoT Development Cookbook
- Yatish Patil
- 88字
- 2021-07-02 20:50:38
How to do it...
In this section, we will create a device job to update the device twin properties:
- 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);
- 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);
}
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- HTML5移動Web開發技術
- Docker技術入門與實戰(第3版)
- Building a RESTful Web Service with Spring
- Building Mapping Applications with QGIS
- Visual Basic程序設計實踐教程
- C語言程序設計實驗指導 (第2版)
- Programming with CodeIgniterMVC
- Raspberry Pi Robotic Projects(Third Edition)
- Node.js 12實戰
- 石墨烯改性塑料
- Java程序設計實用教程(第2版)
- Clojure Web Development Essentials
- C++17 By Example
- ASP.NET Core and Angular 2