-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_protocol.proto
271 lines (246 loc) · 5.26 KB
/
demo_protocol.proto
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
syntax = "proto3";
package demo_protocol;
message HostPayload {
HostProfile profile = 1;
HostDevStatus devStatus = 2;
CommandResponse response = 3;
}
message ClientPayload {
ClientProfile profile = 1;
ClientDevStatus devStatus = 2;
Command command = 3;
CommandResponse response = 4;
}
message CommandResponse {
oneof oneofCommandResponse {
StatusOk statusOk = 1;
StatusError statusErr = 2;
}
}
message Command
{
oneof oneofCommand {
SetZoomLevel setZoom = 1;
SetColorScheme setPallette = 2;
SetAgcMode setAgc = 3;
SetDistance setDst = 4;
SetHoldoff setHoldoff = 5;
SetZeroing setZeroing = 6;
SetCompassOffset setMagOffset = 7;
SetAirTemp setAirTC = 8;
SetAirHumidity setAirHum = 9;
SetAirPressure setAirPress = 10;
SetPowderTemp setPowderTemp = 11;
SetWind setWind = 12;
ButtonPress buttonPress = 13;
TriggerCmd cmdTrigger = 14;
GetHostDevStatus getHostDevStatus = 15;
GetHostProfile getHostProfile = 16;
}
}
message StatusOk
{
OkStatusCode code = 1;
}
message StatusError
{
ErrorStatusCode code = 1;
string text = 2;
}
enum OkStatusCode {
UNKNOWN_OK_STATUS = 0;
SUCCESS = 1;
}
enum ErrorStatusCode {
UNKNOWN_ERROR_STATUS = 0;
FAILURE = 1;
INVALID_DATA = 2;
}
message SetZoomLevel {
Zoom zoomLevel = 1;
}
message SetColorScheme {
ColorScheme scheme = 1;
}
message GetHostDevStatus {
}
message GetHostProfile {
}
message SetAirTemp {
int32 temperature = 1; //[-100..100] C°
}
message SetPowderTemp {
int32 temperature = 1; //[-100..100] C°
}
message SetAirHumidity {
int32 humidity = 1; //[0..100]%
}
message SetAirPressure {
int32 pressure = 1; //[3000..12000] decaPascal
}
message SetWind {
int32 direction = 1; //[0..359] °
int32 speed = 2; //[0..200] deciMeter per second
}
message SetDistance {
int32 distance = 1; //deciMeter
}
message SetAgcMode {
AGCMode mode = 1;
}
message SetCompassOffset {
int32 offset = 1; //[-360..360] °
}
message SetHoldoff{
int32 x = 1; //x1000 125 increments [-600000..600000] 20500 = 20.5 1x; 41 2x; 61.5 3x etc.
int32 y = 2; //x1000 125 increments [-600000..600000]
}
message ButtonPress{
ButtonEnum buttonPressed = 1;
}
message TriggerCmd{
CMDDirect cmd = 1;
}
message SetZeroing{
int32 x = 1; //x1000 125 increments [-600000..600000]
int32 y = 2; //x1000 125 increments [-600000..600000]
}
message HostDevStatus {
int32 charge = 1; // Represented as percentage
Zoom zoom = 2; // zoom multiplier
int32 airTemp = 3; //-100..100 C°
int32 airHum = 4; //0..100%
int32 airPress = 5; //3000..12000 decaPascal
int32 powderTemp = 6; //-100..100 C°
int32 windDir = 7; //0..359 °
int32 windSpeed = 8; //0..200 deciMeter per second
int32 pitch = 9; //-90..90 °
int32 cant = 10; //-90..90 °
int32 distance = 11; //deciMeter
int32 currentProfile = 12; //profile index
}
message ClientDevStatus {
}
enum ColorScheme {
UNKNOWN_COLOR_SHEME = 0;
SEPIA = 1;
BLACK_HOT = 2;
WHITE_HOT = 3;
}
enum AGCMode {
UNKNOWN_AGC_MODE = 0;
AUTO_1 = 1;
AUTO_2 = 2;
}
enum Zoom {
UNKNOWN_ZOOM_LEVEL = 0;
ZOOM_X1 = 1;
ZOOM_X2 = 2;
ZOOM_X3 = 3;
ZOOM_X4 = 4;
ZOOM_X6 = 5;
}
enum ButtonEnum {
UNKNOWN_BUTTON = 0;
MENU_SHORT = 1;
MENU_LONG = 2;
UP_SHORT = 3;
UP_LONG = 4;
DOWN_SHORT = 5;
DOWN_LONG = 6;
LRF_SHORT = 7;
LRF_LONG = 8;
REC_SHORT = 9;
REC_LONG = 10;
}
enum CMDDirect {
UNKNOWN_CMD_DIRECTION = 0;
CALIBRATE_ACCEL_GYRO = 1;
LRF_MEASUREMENT = 2;
RESET_CM_CLICKS = 3;
}
message CoefRow {
int32 bc_cd = 1;
int32 mv = 2;
}
enum DType {
VALUE = 0;
INDEX = 1;
}
message SwPos {
int32 c_idx = 1;
int32 reticle_idx = 2;
int32 zoom = 3;
int32 distance = 4;
DType distance_from = 5;
}
enum GType {
G1 = 0;
G7 = 1;
CUSTOM = 2;
}
enum TwistDir {
RIGHT = 0;
LEFT = 1;
}
message HostProfile {
string profile_name = 1;
string cartridge_name = 2;
string bullet_name = 3;
string short_name_top = 4;
string short_name_bot = 5;
string user_note = 6;
int32 zero_x = 7;
int32 zero_y = 8;
int32 sc_height = 9;
int32 r_twist = 10;
int32 c_muzzle_velocity = 11;
int32 c_zero_temperature = 12;
int32 c_t_coeff = 13;
int32 c_zero_distance_idx = 14;
int32 c_zero_air_temperature = 15;
int32 c_zero_air_pressure = 16;
int32 c_zero_air_humidity = 17;
int32 c_zero_w_pitch = 18;
int32 c_zero_p_temperature = 19;
int32 b_diameter = 20;
int32 b_weight = 21;
int32 b_length = 22;
TwistDir twist_dir = 23;
GType bc_type = 24;
repeated SwPos switches = 25;
repeated int32 distances = 26;
repeated CoefRow coef_rows = 27;
string caliber = 28;
string device_uuid = 29;
}
message ClientProfile {
reserved 1, 2, 3;
reserved "profile_name", "cartridge_name", "bullet_name";
string short_name_top = 4;
string short_name_bot = 5;
string user_note = 6;
int32 zero_x = 7;
int32 zero_y = 8;
int32 sc_height = 9;
int32 r_twist = 10;
int32 c_muzzle_velocity = 11;
int32 c_zero_temperature = 12;
int32 c_t_coeff = 13;
int32 c_zero_distance_idx = 14;
int32 c_zero_air_temperature = 15;
int32 c_zero_air_pressure = 16;
int32 c_zero_air_humidity = 17;
int32 c_zero_w_pitch = 18;
int32 c_zero_p_temperature = 19;
int32 b_diameter = 20;
int32 b_weight = 21;
int32 b_length = 22;
TwistDir twist_dir = 23;
GType bc_type = 24;
repeated SwPos switches = 25;
repeated int32 distances = 26;
repeated CoefRow coef_rows = 27;
string caliber = 28;
string device_uuid = 29;
}