DeviceTwin 时间戳

DeviceTwin timestamps

我在 azure-iot-sdk-csharp 的 github 中提交了 UpdateReportedPropertiesAsync doesn't update the Device Twin timestamps,但我想知道是不是我只是不知道什么,所以我决定在这里问嗯。

是否有说明 IoT 中心设备孪生的 statusUpdateTimeconnectionStatelastActivityTime 何时更新的文档?


我的问题:

我有一台设备使用 DeviceClientUpdateReportedPropertiesAsync 定期更新报告的属性,但时间戳保持为空:

"statusUpdateTime": "0001-01-01T00:00:00",
"connectionState": "Connected",
"lastActivityTime": "0001-01-01T00:00:00",

Is there documentation explaining when IoT Hub Device Twin's statusUpdateTime, connectionState, and lastActivityTime are updated?

您可以参考“Device identity properties”部分。

I have a device that periodically updates reported properties using DeviceClient's UpdateReportedPropertiesAsync but the timestamps stay empty:

好像是老SDK的问题,已经修复了。我使用 Microsoft.Azure.Devices.Client 1.18.0,它适用于我。你可以试试。

            TwinCollection reportedProperties = new TwinCollection();
            reportedProperties["DateTimeLastDesiredPropertyChangeReceived"] = DateTime.Now;

            await deviceClient.UpdateReportedPropertiesAsync(reportedProperties).ConfigureAwait(false);