-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathspec.thrift
91 lines (76 loc) · 1.35 KB
/
spec.thrift
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
enum ButtonID {
A,
B,
X,
Y,
SELECT,
START,
THUMBL,
THUMBR,
TL,
TR,
L2,
R2,
PAD_UP,
PAD_DOWN,
PAD_LEFT,
PAD_RIGHT,
DUMMY = 999,
}
enum AxisID {
LX,
LY,
RX,
RY,
THROTTLE_L,
THROTTLE_R,
PAD_X,
PAD_Y
}
enum Mode {
IDLE,
WALK,
CXYZ,
CYPR,
OLEG,
CALI = 99,
}
enum Giat {
TRIP,
WAVE,
RIPP,
TATR,
}
const map<ButtonID,string> BUTTON_NAMES = {
ButtonID.A: 'a',
ButtonID.B: 'b',
ButtonID.X: 'x',
ButtonID.Y: 'y',
ButtonID.SELECT: 'select',
ButtonID.START: 'start',
ButtonID.THUMBL: 'thumbl',
ButtonID.THUMBR: 'thumbr',
ButtonID.TL: 'tl',
ButtonID.TR: 'tr',
ButtonID.L2: 'l2',
ButtonID.R2: 'r2',
ButtonID.PAD_UP: 'pad_up',
ButtonID.PAD_DOWN: 'pad_down',
ButtonID.PAD_LEFT: 'pad_left',
ButtonID.PAD_RIGHT: 'pad_right',
}
struct ARR_status {
1: required i16 mode;
2: required i16 sub_mode;
3: required i16 speed;
4: optional bool light_1 = false;
5: optional bool light_2 = false;
6: optional i16 battery = 0;
}
service ARR_proto {
bool ping(),
oneway void axis(1:AxisID id, 2:double value),
oneway void button(1:ButtonID id, 2:bool value),
ARR_status get_status(),
list<string> get_logs(1: i32 offset),
}