-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathsensor.idol
124 lines (123 loc) · 3.28 KB
/
sensor.idol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Sensor API
Interface(
name: "Sensor",
ops: {
"get": (
args: {
"id": (
type: "SensorId",
),
},
reply: Result(
ok: "f32",
err: CLike("SensorError"),
),
encoding: Hubpack,
idempotent: true,
),
"get_reading": (
args: {
"id": (
type: "SensorId",
)
},
reply: Result(
ok: "Reading",
err: CLike("SensorError"),
),
encoding: Hubpack,
idempotent: true,
),
"get_raw_reading": (
description: "returns the most recent reading (data or error) and its timestamp",
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("Option<(Result<f32, NoData>, u64)>"),
encoding: Hubpack,
idempotent: true,
),
"get_last_data": (
description: "returns the most recent data reading and its timestamp",
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("Option<(f32, u64)>"),
encoding: Hubpack,
idempotent: true,
),
"get_last_nodata": (
description: "returns the most recent error recorded and its timestamp",
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("Option<(NoData, u64)>"),
encoding: Hubpack,
idempotent: true,
),
"get_min": (
description: "returns the minimum value recorded and its timestamp",
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("(f32, u64)"),
encoding: Hubpack,
idempotent: true,
),
"get_max": (
description: "returns the maximum value recorded and its timestamp",
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("(f32, u64)"),
encoding: Hubpack,
idempotent: true,
),
"post": (
args: {
"id": (
type: "SensorId",
),
"value": "f32",
"timestamp": "u64",
},
reply: Simple("()"),
encoding: Hubpack,
idempotent: true,
),
"nodata": (
args: {
"id": (
type: "SensorId",
),
"nodata": (
type: "NoData",
),
"timestamp": "u64",
},
reply: Simple("()"),
idempotent: true,
encoding: Hubpack,
),
"get_nerrors": (
args: {
"id": (
type: "SensorId",
)
},
reply: Simple("u32"),
idempotent: true,
encoding: Hubpack,
),
},
)