-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrox6.mli
185 lines (159 loc) · 4.28 KB
/
rox6.mli
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
module Bike_entry :
sig
type t = {
ts : int; (* s *)
wheel_rot : int;
duration : int; (* s *)
speed : float; (* km/h *)
cadence : int; (* rpm *)
hr : int; (* bpm *)
alt : float; (* m *)
temp : int; (* °C *)
distance : float; (* m *)
abs_distance : float; (* m *)
unadj_distance : float; (* m *)
}
end
module Bike_lap :
sig
type t = {
ts : int; (* s *)
wheel_rot : int;
duration : int; (* s *)
avg_speed : float; (* km/h *)
avg_hr : int; (* bpm *)
max_hr : int; (* bpm *)
avg_cadence : int; (* rpm *)
kcal : int; (* kcal *)
max_speed : float; (* km/h *)
alt_gain : float; (* m *)
alt_loss : float; (* m *)
distance : float; (* m *)
abs_distance : float; (* m *)
}
end
module Bike_pause :
sig
type t = {
ts : int; (* s *)
wheel_rot : int;
avg_alt : float; (* m *)
start_date : Date.t;
start_time : Time.t;
stop_date : Date.t;
stop_time : Time.t;
distance : float; (* m *)
abs_distance : float; (* m *)
}
end
module Hike_entry :
sig
type t = string
end
module Hike_pause :
sig
type t = string
end
module Log_entry :
sig
type t = Bike of Bike_entry.t
| Bike_lap of Bike_lap.t
| Bike_pause of Bike_pause.t
| Hike of Hike_entry.t
| Hike_pause of Hike_pause.t
end
module Log_summary :
sig
type t = {
start_date : Date.t; (** *)
start_time : Time.t;
(** Rider's age (years). *)
age : int;
(** Rider's body mass (kilograms). *)
mass : float;
(** Rider's sex. *)
sex : Sex.t;
(** Rider's maximum heart rate (beats per minute). *)
max_hr : int;
(** Lower and upper heart rate limits of rider's own training zone
* (beats per minute). *)
hr_limits : int * int;
training_zone : Training_zone.t;
zone_start : float * float * float * float; (* frac of max_hr *)
bike_no : Bike_no.t;
wheel_circum : float; (* m *)
distance : float; (* m *)
duration : int; (* s *)
max_speed : float * int; (* km/h, log entry index *)
alt_gain : float; (* m*)
alt_loss : float; (* m *)
kcal : int; (* kcal *)
hike_duration : int; (* s *)
hike_alt_gain : float; (* m *)
hike_alt_loss : float; (* m *)
hike_kcal : int; (* kcal *)
speed_unit : Speed_unit.t;
mass_unit : Mass_unit.t;
log_size : int; (* size of log in device memory *)
}
val recv : Ser_port.t -> t
end
module Log :
sig
type t = Log_entry.t list
val recv : Ser_port.t -> Log_summary.t -> t
end
module Settings :
sig
type t = {
(* Person *)
age : int; (* y *)
mass : float; (* kg *)
sex : Sex.t;
(* Heart rate *)
max_hr : int; (* bpm *)
hr_limits : int * int; (* bpm *)
(* Training zones *)
training_zone : Training_zone.t;
zone_alarm : bool;
zone_start : float * float * float * float; (* frac of max_hr *)
(* Bike *)
wheel_circum : float * float; (* m *)
(* Date and time *)
date : Date.t;
time : Time.t;
(* Altitude *)
slp : int; (* Pa *)
actual_alt : float; (* m *)
home_alt : float; (* m *)
alt_ref : Alt_ref.t;
(* Device *)
lang : Lang.t;
date_format : Date_format.t;
speed_unit : Speed_unit.t;
mass_unit : Mass_unit.t;
contrast : Contrast.t;
low_bat : Low_bat.t;
(* Service interval *)
serv_interval : bool * int; (* km *)
}
val recv : Ser_port.t -> t
end
module Totals :
sig
type t = {
distance : float * float;
duration : int * int;
alt_gain : float * float;
kcal : int * int;
hike_duration : int;
hike_alt_gain : float;
hike_kcal : int;
}
val recv : Ser_port.t -> t
end
module Bat_status :
sig
type t = Ok | Low
val recv : Ser_port.t -> t
end