-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommand_schemas.proto
422 lines (371 loc) · 10.9 KB
/
command_schemas.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
syntax = "proto2";
import "nanopb.proto";
enum ColorPalette {
// FastLED
RAINBOW = 0;
FOREST = 1;
OCEAN = 2;
PARTY = 3;
// HEAT = 4;
// LAVA = 5;
// CLOUD = 6;
// Custom
SCOUTY = 7;
// PURPLE_HEAT = 8;
// SPRING_ANGEL = 9;
// SAGA = 10;
// SAGA2 = 11;
// PARROT = 12;
// WLED
// SUNSET_REAL = 13;
RIVENDELL = 14;
// OCEAN_BREEZE = 15;
// RGI = 16;
// RETRO2 = 17;
// ANALOGOUS = 18;
// PINKSPLASH = 19;
// SUNSET_YELLOW = 20;
// ANOTHER_SUNSET = 21;
// BEECH = 22;
// VINTAGE = 23;
// DEPARTURE = 24;
// LANDSCAPE = 25;
// LANDSCAPE2 = 26;
// RAINBOWSHERBET = 27;
// HULT = 28;
// HULT2 = 29;
// DRYWET = 30;
// JUL = 31;
// VINTAGE2 = 32;
// IB15 = 33;
// TERTIARY = 34;
// LAVA2 = 35;
// FIERCE_ICE = 36;
// COLORFULL = 37;
// PINK_PURPLE = 38;
// AUTUMN = 39;
// BLACK_BLUE_MAGENTA_WHITE = 40;
// BLACK_MAGENTA_RED = 41;
// BLACK_RED_MAGENTA_YELLOW = 42;
// BLUE_CYAN_YELLOW = 43;
ORANGE_TEAL = 44;
// TIAMAT = 45;
// APRIL_NIGHT = 46;
ORANGERY = 47;
// C9 = 48;
SAKURA = 49;
AURORA = 50;
ATLANTICA = 51;
// C92 = 52;
// C93 = 53;
// TEMPERATURE = 54;
// AURORA2 = 55;
}
enum Shape1D {
BALL = 0;
COMET = 1;
// COMET_BOUNCE = 2;
NYAN = 3;
// NYAN_BOUNCE = 4;
FILLED = 5;
}
enum Shape2D {
SQUARE = 0;
CIRCLE = 1;
RING = 2;
// LINE_VERTICAL = 3;
// LINE_HORIZONTAL = 4;
// COMET_VERTICAL = 5;
// COMET_HORIZONTAL = 6;
// FILL_VERTICAL = 7;
// FILL_HORIZONTAL = 8;
}
enum MovementType {
LINEAR = 0;
SINE = 1;
QUADRATIC = 2;
// CUBIC = 3;
SAWTOOTH = 4;
SAWTOOTH_REVERSE = 5;
RANDOM = 6;
RANDOM_TRANSITIONS = 7;
// STEPS = 8;
BEATS_1 = 9;
BEATS_2 = 10;
BEATS_3 = 11;
BEATS_4 = 12;
BEATS_5 = 13;
BEATS_6 = 14;
BEATS_7 = 15;
BEATS_ALL = 16;
JOYSTICK_X = 17;
JOYSTICK_Y = 18;
}
enum SlopeType {
LINE = 0;
FILL = 1;
COLOR_SHIFT = 2;
}
enum FairyPattern {
ODD_EVEN = 0;
ODD_EVEN_ALL = 1;
}
enum ColorType {
RANDOM_COLOR = 0;
SINGLE_COLOR = 1;
WHITE = 2;
}
message WireMessage {
required int32 sequence = 1 [default = 0]; // deprecated
oneof message {
CommandParams command_params = 2;
TimeSync time_sync = 3;
JoystickEvent joystick_event = 4;
TargetMetrics target_metrics = 5;
RemoteLog remote_log = 9;
ColorPaletteRequest color_palette_request = 6;
ColorPaletteResponse color_palette_response = 7;
FirmwareConfig firmware_config = 8;
// events
PixelFuncEvent pixel_func_event = 100;
FadeOutEvent fade_out_event = 101;
}
}
message CommandParams {
required int32 index = 1;
required bool enabled = 2 [default = true];
required int32 brightness = 3 [default = 255];
required int32 strip_index = 4 [default = 0];
required ColorPalette color_palette = 5 [default = RAINBOW];
repeated Modifier modifiers = 6 [(nanopb).max_count = 5];
required bytes hash = 100 [default = "", (nanopb).max_size = 4];
oneof type_params {
White white = 7;
SingleColor single_color = 8;
Pixel pixel = 9;
PixelRGB pixel_rgb = 10;
Rainbow rainbow = 11;
Sparkle sparkle = 12;
FlickerSparkle flicker_sparkle = 13;
PingPong ping_pong = 14;
Render render =15;
Rain rain = 16;
Gravity gravity = 17;
Kaleidoscope kaleidoscope = 18;
MappedShape mapped_shape = 19;
MappedSlope mapped_slope = 20;
MappedTriangle mapped_triangle = 21;
MappedParticles mapped_particles = 22;
MappedPingPong mapped_ping_pong = 23;
Twang twang = 24;
FairyLight fairy_light = 25;
Calibrate calibrate = 27;
PixelFunc pixel_func = 28;
Debug debug = 29;
RandomWalk random_walk = 30;
FadeOut fade_out = 31;
}
// legacy
required bytes color_1 = 101 [default = "\xFF\x00\x00", (nanopb).max_size = 3];
required bytes color_2 = 102 [default = "\x00\xFF\x00", (nanopb).max_size = 3];
}
message TimeSync {
required uint64 millis = 1;
}
message Modifier {
required MovementType movement_type = 1 [default = SINE];
required int32 field_index = 2 [default = 0];
required int32 period_100ms = 3 [default = 50];
required int32 offset_100ms = 4 [default = 0];
required int32 min = 5 [default = 0];
required int32 max = 6 [default = 255];
}
message White {
required int32 color_temperature = 1 [default = 0, (nanopb).max_size=5];
}
message SingleColor {
required int32 color = 1 [default = 226];
}
message Calibrate {
required int32 red = 1 [default = 130];
required int32 green = 2 [default = 130];
required int32 blue = 3 [default = 130];
}
message Pixel {
required int32 color = 1 [default = 0];
required int32 led_index = 2 [default = 0];
}
message PixelRGB {
required int32 red = 1 [default = 130];
required int32 green = 2 [default = 130];
required int32 blue = 3 [default = 130];
required int32 led_index = 4 [default = 0];
}
message Rainbow {
required int32 speed = 1 [default = 30];
required int32 wave_size = 2 [default = 100];
required int32 rainbow_size = 3 [default = 152];
}
message Sparkle {
required int32 color = 1 [default = 200];
required int32 sparkle_width = 2 [default = 15];
required int32 sparle_rate = 3 [default = 30];
required int32 duration = 4 [default = 100];
optional ColorType color_type = 5 [default = SINGLE_COLOR];
}
message FlickerSparkle {
required int32 color = 1 [default = 255];
required int32 sparkle_width = 2 [default = 90];
required int32 sparles_per_second = 3 [default = 215];
required int32 duration = 4 [default = 8];
required int32 flicker_delay = 5 [default = 7];
required int32 flicker_window = 6 [default = 119];
required int32 max_flickers = 7 [default = 80];
optional ColorType color_type = 8 [default = WHITE];
}
message PingPong {
required Shape1D shape = 1 [default = BALL];
required MovementType movement = 2 [default = SINE];
required int32 color = 3 [default = 65];
required int32 width = 4 [default = 20];
required int32 count = 5 [default = 1, (nanopb).max_size=20];
required int32 period_100ms = 6 [default = 100];
}
message Render {
required Shape1D shape = 1 [default = BALL];
required int32 color = 2 [default = 210];
required int32 position = 3 [default = 20, (nanopb).max_size=65535];
required int32 width = 4 [default = 20];
}
message Rain {
required int32 color = 1 [default = 0];
required int32 width = 2 [default = 50];
required int32 drop_density = 3 [default = 75];
required int32 drop_speed = 4 [default = 50];
optional ColorType color_type = 5 [default = RANDOM_COLOR];
}
message Gravity {
required int32 color = 1 [default = 13];
required int32 launch_speed = 2 [default = 185];
required int32 ball_rate = 3 [default = 50];
required int32 width = 4 [default = 50];
optional ColorType color_type = 5 [default = RANDOM_COLOR];
}
message Kaleidoscope {
}
message MappedSlope{
required int32 color = 1 [default = 1];
required SlopeType slope_type = 2 [default = FILL];
required int32 x1 = 3 [default = 0];
required int32 y1 = 4 [default = 0];
required int32 x2 = 5 [default = 255];
required int32 y2 = 6 [default = 255];
required int32 fade_distance = 7 [default = 5];
}
message MappedShape {
required int32 color = 1 [default = 1];
required Shape2D shape = 2 [default = SQUARE];
required int32 x = 3 [default = 128];
required int32 y = 4 [default = 128];
required int32 size = 5 [default = 50];
required int32 fade_distance = 6 [default = 50];
}
message MappedTriangle {
required int32 color = 1 [default = 1];
required int32 x1 = 2 [default = 0];
required int32 y1 = 3 [default = 0];
required int32 x2 = 4 [default = 255];
required int32 y2 = 5 [default = 000];
required int32 x3 = 6 [default = 128];
required int32 y3 = 7 [default = 255];
}
message MappedParticles {
required int32 color = 1 [default= 177];
required Shape2D shape = 2 [default = CIRCLE];
required int32 x = 3 [default = 128];
required int32 y = 4 [default = 128];
required int32 size = 5 [default = 50];
required int32 fade_distance = 6 [default = 50];
}
message MappedPingPong {
required int32 color = 1 [default = 123];
required int32 direction = 2 [default = 0];
required int32 fade_distance = 3 [default = 5];
}
message PixelFunc {
required string function = 1 [ default = "sin(2*t-hypot(x-3.5,y-3.5))", (nanopb).max_length = 80];
// required int32 color_distance = 2 [ default = 100 ];
}
message PixelFuncEvent {
required int32 a = 1 [default = 0];
required int32 b = 2 [default = 0];
}
message Debug {
required int32 param1 = 1 [default = 0];
required int32 param2 = 2 [default = 0];
required int32 param3 = 3 [default = 0];
}
message FadeOut {
}
message FadeOutEvent {
required Shape1D shape = 1 [default = BALL];
required int32 strip_index = 2 [default = 0];
required int32 position = 3 [default = 20, (nanopb).max_size=65535];
required int32 width = 4 [default = 20];
required int32 color = 5 [default = 210];
required int32 brightness = 6 [default = 255];
required int32 decay = 7 [default = 10];
}
message RandomWalk {
required Shape1D shape = 1 [default = BALL];
required int32 color = 2 [default = 65];
required int32 width = 3 [default = 20];
required int32 count = 4 [default = 1, (nanopb).max_size=10];
required int32 speed = 6 [default = 100];
}
message Twang {
}
message FairyLight {
required FairyPattern fairy_pattern = 1 [default = ODD_EVEN];
required int32 frequency = 2 [default = 20];
required int32 fairy_index = 3 [default = 0];
}
message JoystickEvent {
required int32 x = 1 [default = 0];
required int32 y = 2 [default = 0];
required bool button1 = 3 [default = false];
required bool button2 = 4 [default = false];
required bool button3 = 5 [default = false];
required bool button4 = 6 [default = false];
}
message TargetMetrics {
required string name = 1 [(nanopb).max_length = 20];
required int32 fps = 2;
required int32 wifi_strength = 3;
required string version = 4 [(nanopb).max_length = 20];
repeated bytes hashes = 5 [(nanopb).max_size = 4, (nanopb).max_count = 8];
required int32 max_strip_index = 6;
required uint32 heap_size = 12;
required uint32 free_heap = 13;
required uint32 cpu_freq_mhz = 14;
required string chip_model = 15 [(nanopb).max_length = 20];
required uint32 chip_revision = 16;
required string sdk_version = 17 [(nanopb).max_length = 20];
}
message RemoteLog {
required string message = 1 [(nanopb).max_length = 100];
}
message ColorPaletteRequest {
required ColorPalette color_palette = 1;
}
message ColorPaletteResponse {
required ColorPalette color_palette = 1;
repeated uint32 colors = 2 [(nanopb).max_count = 256, (nanopb).fixed_count = true];
}
message FirmwareConfig {
required uint32 phash = 1 [default = 0];
required bool calibration_fastled = 2 [default = true];
required bool calibration_custom = 3 [default = false];
// required bool calibration_lookup_table = 4 [default = false];
required bool gamma_correction = 5 [default = true];
}