2025-03-17 10:14:41 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
message Energy {
|
|
|
|
uint32 mAh = 1;
|
|
|
|
}
|
|
|
|
message TimePoint {
|
|
|
|
uint64 millis_since_epoch = 1;
|
|
|
|
}
|
|
|
|
message Duration {
|
|
|
|
uint32 millis = 1;
|
|
|
|
}
|
|
|
|
message Temperature {
|
|
|
|
double celsius = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StatusRequest {}
|
|
|
|
message SensorStatus {
|
|
|
|
string name = 1;
|
|
|
|
TimePoint online_since = 2;
|
|
|
|
Energy battery_charge = 3;
|
|
|
|
Energy battery_capacity = 4;
|
|
|
|
Duration max_sampling_period = 5;
|
|
|
|
Duration cur_sampling_period = 6;
|
|
|
|
uint32 max_chunk_size = 7;
|
|
|
|
uint32 cur_chunk_size = 8;
|
|
|
|
uint32 n_chunk_capacity = 9;
|
|
|
|
uint32 n_full_data_chunks = 10;
|
|
|
|
uint32 n_empty_data_chunks = 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DataChunkRequest {}
|
|
|
|
message DataChunk {
|
|
|
|
TimePoint begin = 1;
|
|
|
|
Duration period = 2;
|
|
|
|
repeated Temperature data = 3;
|
|
|
|
}
|
|
|
|
|
2025-03-19 17:30:38 +01:00
|
|
|
enum SetSamplingPeriodResultEnum {
|
|
|
|
OK = 0;
|
|
|
|
OutOfRange = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetSamplingPeriodResult {
|
|
|
|
SetSamplingPeriodResultEnum result = 1;
|
|
|
|
}
|
2025-03-17 10:14:41 +01:00
|
|
|
|
|
|
|
service Sensor {
|
|
|
|
rpc get_status (StatusRequest) returns (SensorStatus) {}
|
|
|
|
rpc set_sampling_period (Duration) returns (SetSamplingPeriodResult) {}
|
|
|
|
rpc pop_data_chunk (DataChunkRequest) returns (DataChunk) {}
|
|
|
|
}
|