smart-sensor-example/random-sensor-ldmc/sensor-internal.lt

31 lines
1.1 KiB
Text
Raw Permalink Normal View History

include "../sensor.lt";
type native.SensorStatus = SensorStatus ~ {
online_since : TimePoint ~ <TimeSince UnixEpoch> ~ Milliseconds ~ ~ native.UInt64 ;
battery_charge : Energy ~ mAh ~ native.UInt32 ;
battery_capacity : Energy ~ mAh ~ native.UInt32 ;
min_sampling_period : Duration ~ Milliseconds ~ native.UInt32 ;
cur_sampling_period : Duration ~ Milliseconds ~ native.UInt32 ;
max_chunk_size : ~ native.UInt32 ;
cur_chunk_size : ~ native.UInt32 ;
n_chunk_capacity : ~ native.UInt32 ;
n_full_data_chunks : ~ native.UInt32 ;
n_empty_data_chunks : ~ native.UInt32 ;
} ;
type native.DataChunk = DataChunk ~ {
begin : TimePoint ~ <TimeSince UnixEpoch> ~ Milliseconds ~ native.UInt64 ;
data : [~<LengthPrefix x86.UInt32>
Temperature
~ Celsius
~
~ native.Float64
] ;
} ;
type native.Sensor = Sensor ~ {
get_status : {} -> InternSensorStatus ;
set_sampling_period : Duration~Milliseconds~UInt32 -> (Ok | OutOfRange)~Byte ;
pop_data_chunk : {} -> InternDataChunk ;
} ;