azure - DeviceTwin 时间戳
问题描述
我提交了UpdateReportedPropertiesAsync 不会更新azure-iot-sdk-csharp 的 github 中的 Device Twin 时间戳,但我想知道我是否只是不知道一些事情,所以我决定也在这里问一下。
是否有文档解释 IoT 中心设备孪生的statusUpdateTime
、connectionState
和何时lastActivityTime
更新?
我的问题:
我有一个使用DeviceClient
's定期更新报告属性的设备,UpdateReportedPropertiesAsync
但时间戳保持为空:
"statusUpdateTime": "0001-01-01T00:00:00",
"connectionState": "Connected",
"lastActivityTime": "0001-01-01T00:00:00",
解决方案
是否有说明 IoT 中心设备孪生的 statusUpdateTime、connectionState 和 lastActivityTime 何时更新的文档?
您可以参考“设备标识属性”部分。
我有一个使用 DeviceClient 的 UpdateReportedPropertiesAsync 定期更新报告属性的设备,但时间戳保持为空:
这似乎是旧 SDK 的问题,并且已经修复。我使用 Microsoft.Azure.Devices.Client 1.18.0,它对我有用。你可以试一试。
TwinCollection reportedProperties = new TwinCollection();
reportedProperties["DateTimeLastDesiredPropertyChangeReceived"] = DateTime.Now;
await deviceClient.UpdateReportedPropertiesAsync(reportedProperties).ConfigureAwait(false);
推荐阅读
- icons - 我在哪里可以获得材料图标的代码?
- javascript - 使用正则表达式从字符串中获取值
- powerbi - 在 power bi 有条件地在卡片或表格视觉下方添加超链接
- apache-flink - Apache Beam 是否支持迭代算法,就像 Apache Flink 一样?
- assembly - MIPS32:ld 伪指令翻译
- ibm-cloud-private - 为什么我不能在 ICP(IBM 云私有)中为与 OIDC 集成的普通用户使用 API
- python - 在 centos7 上安装 pip(3) 的推荐方法
- jenkins - 使用在 Jenkinsfile 内部构建的其他作业中创建的变量
- matlab - Matlab按钮继续
- java - 比较两个街道地址或纬度经度数字