initial virtual sensor with protobuf
This commit is contained in:
commit
cbee09be85
7 changed files with 326 additions and 0 deletions
25
sensor.lt
Normal file
25
sensor.lt
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
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 ;
|
||||
data : [ Temperature ] ;
|
||||
}
|
||||
|
||||
trait Sensor = {
|
||||
get_status : {} -> SensorStatus ;
|
||||
set_sampling_period : Duration -> (Ok | OutOfRange);
|
||||
pop_data_chunk : {} -> DataChunk ;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue