代码之家  ›  专栏  ›  技术社区  ›  tmaj

DeviceTwin时间戳

  •  0
  • tmaj  · 技术社区  · 7 年前

    我提交了 UpdateReportedPropertiesAsync doesn't update the Device Twin timestamps 在azureiotsdkcsharp的github中,但是我想知道是否我只是不知道一些事情,所以我决定在这里问一下。

    statusUpdateTime , connectionState ,和 lastActivityTime


    我的问题是:

    我有一个设备,定期更新报告的属性使用 DeviceClient UpdateReportedPropertiesAsync 但是时间戳是空的:

    "statusUpdateTime": "0001-01-01T00:00:00",
    "connectionState": "Connected",
    "lastActivityTime": "0001-01-01T00:00:00",
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Rita Han    7 年前

    是否有文件说明IoT Hub Device Twin

    Device identity properties “部分。

    enter image description here

    我有一个设备,定期更新报告的属性使用 空的:

    这似乎是一个老的SDK的问题,它已经被修复。我用Microsoft.Azure.Devices.Client 1.18.0,对我有用。你可以试试。

                TwinCollection reportedProperties = new TwinCollection();
                reportedProperties["DateTimeLastDesiredPropertyChangeReceived"] = DateTime.Now;
    
                await deviceClient.UpdateReportedPropertiesAsync(reportedProperties).ConfigureAwait(false);
    

    enter image description here