| edition = "2023"; |
| |
| package milotic_tlbmc; |
| |
| import "google/protobuf/duration.proto"; |
| import "google/protobuf/timestamp.proto"; |
| import "entity_common_config.proto"; |
| import "i2c_common_config.proto"; |
| import "reading_range_config.proto"; |
| import "reading_transform_config.proto"; |
| import "threshold_config.proto"; |
| import "resource.proto"; |
| |
| enum SensorUnit { |
| UNIT_UNKNOWN = 0; |
| UNIT_DEGREE_CELSIUS = 1; |
| UNIT_WATT = 2; |
| UNIT_AMPERE = 3; |
| UNIT_VOLT = 4; |
| UNIT_REVOLUTION_PER_MINUTE = 5; |
| UNIT_PERCENT = 6; |
| } |
| |
| message SensorValue { |
| double reading = 1; |
| google.protobuf.Timestamp timestamp = 2; |
| } |
| |
| message SensorAttributesStatic { |
| Attributes attributes = 1; |
| SensorUnit unit = 2; |
| ThresholdConfigs thresholds = 3; |
| ReadingRangeConfigs reading_ranges = 4; |
| EntityCommonConfig entity_common_config = 5; |
| google.protobuf.Duration static_refresh_interval = 6; |
| I2cCommonConfig i2c_common_config = 7; |
| ReadingTransformConfig reading_transform = 8; |
| } |
| |
| message SensorAttributesDynamic { |
| State state = 1; |
| // The refresh interval of the sensor. |
| google.protobuf.Duration refresh_interval = 2; |
| // Threshold for data points in the buffer reaching which the sensor will |
| // trigger a notification. |
| int32 data_points_to_notify = 3; |
| // The number of data points buffered. |
| int32 data_points_buffered = 4; |
| } |
| |
| // The metrics for the sensor. |
| // Ideally, we should see `average_hardware_polling_latency` being very small, |
| // and `average_software_polling_start_interval` and |
| // `average_software_polling_end_interval` being closed to the configured |
| // refresh interval. |
| message SensorMetrics { |
| // The average latency for the hardware polling. |
| // One latency is measured as time between sending the request to the HAL and |
| // receiving the response. |
| // This metrics can indicate whether the device is the bottleneck. |
| google.protobuf.Duration average_hardware_polling_latency = 1; |
| // The average interval for the software polling start. |
| // One interval is measured as time between two consecutive refresh schedule |
| // start timepoints. |
| // This metrics can indicate whether the software, e.g., the scheduler, is the |
| // bottleneck. |
| google.protobuf.Duration average_software_polling_start_interval = 2; |
| // The average interval for the software polling end. |
| // One interval is measured as time between two consecutive hardware response |
| // received timepoints. |
| // This metrics can supplement the above metrics to |
| // indicate how the software and the device are performing together. |
| google.protobuf.Duration average_software_polling_end_interval = 3; |
| } |