当使用模拟设备时,您可以从“fragmentTypes”字段获得其支持的测量值(即c8y_SupportedMeasurements),例如,温度传感器的测量结果如下所示:
c8y_SupportedMeasurements:"c8y_TemperatureMeasurement“
当使用真正的设备时,此字段不可用。在获取特定设备的测量数据时,我可以看到可能的fragmentTypes。
/测量/测量?源=id
它给出了以下fragmentTypes的度量列表:
以与模拟器和"c8y_SupportedMeasurements"-field类似的方式获取设备所支持的-field的正确方法是什么?
发布于 2016-06-15 09:51:14
c8y_SupportedMeasurements是由Cumulocity自动生成的碎片。当设备发送带有新片段的度量时,它会更新。
您可以直接为这样的设备查询受支持的度量(它将只返回c8y_SupportedMeasurements而不是整个设备对象):
/inventory/managedObjects/{{deviceId}}/supportedMeasurements
如果不存在碎片,此调用还将根据设备的历史数据触发supportedMeasurements的初始计算。
https://stackoverflow.com/questions/37830322
复制相似问题