smart-sensor-example/sensor.lt

27 lines
623 B
Text
Raw Normal View History

2025-03-17 10:14:41 +01:00
trait SensorStatus = {
name : [ Char ] ;
online_since : TimePoint ;
battery_charge : Energy ;
battery_capacity : Energy ;
min_sampling_period : Duration ;
cur_sampling_period : Duration ;
max_chunk_size : ;
cur_chunk_size : ;
n_chunk_capacity : ;
n_full_data_chunks : ;
n_empty_data_chunks : ;
}
trait DataChunk = {
begin : TimePoint ;
sampling_period: Duration ;
2025-03-17 10:14:41 +01:00
data : [ Temperature ] ;
}
trait Sensor = {
get_status : {} -> SensorStatus ;
set_sampling_period : Duration -> (Ok | OutOfRange);
pop_data_chunk : {} -> DataChunk ;
}