-
Notifications
You must be signed in to change notification settings - Fork 8
/
keymapp.proto
118 lines (99 loc) · 2.97 KB
/
keymapp.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
syntax = "proto3";
option go_package = "github.com/zsa/keymapp/api";
package api;
message Keyboard {
int32 id = 1;
string friendly_name = 2;
bool is_connected = 3;
}
message ConnectedKeyboard {
string friendly_name = 1;
string firmware_version = 2;
int32 current_layer = 3;
}
message GetStatusRequest {}
message GetStatusReply {
string keymapp_version = 1;
ConnectedKeyboard connected_keyboard = 2;
}
message GetKeyboardsRequest {}
message GetKeyboardsReply {
repeated Keyboard keyboards = 1;
}
message ConnectAnyKeyboardRequest {}
message ConnectKeyboardRequest {
int32 id = 1;
}
message ConnectKeyboardReply {
bool success = 1;
}
message DisconnectKeyboardRequest {
}
message DisconnectKeyboardReply {
bool success = 1;
}
message SetLayerRequest {
int32 layer = 1;
}
message SetLayerReply {
bool success = 1;
}
message SetRGBLedRequest {
int32 led = 1;
int32 red = 2;
int32 green = 3;
int32 blue = 4;
int32 sustain = 5;
}
message SetRGBLedReply {
bool success = 1;
}
message SetRGBAllRequest {
int32 red = 1;
int32 green = 2;
int32 blue = 3;
int32 sustain = 4;
}
message SetRGBAllReply {
bool success = 1;
}
message SetStatusLedRequest {
int32 led = 1;
bool on = 2;
int32 sustain = 3;
}
message SetStatusLedReply {
bool success = 1;
}
message IncreaseBrightnessRequest {
}
message DecreaseBrightnessRequest {
}
message BrightnessUpdateReply {
bool success = 1;
}
service KeyboardService {
rpc GetStatus (GetStatusRequest) returns (GetStatusReply) {}
// Returns a list of all detected keyboards.
rpc GetKeyboards (GetKeyboardsRequest) returns (GetKeyboardsReply) {}
// Connects to a keyboard using given an id retrieved from GetKeyboards.
rpc ConnectKeyboard (ConnectKeyboardRequest) returns (ConnectKeyboardReply) {}
// Connects to the first available keyboard.
rpc ConnectAnyKeyboard (ConnectAnyKeyboardRequest) returns (ConnectKeyboardReply) {}
// Disconnects to a keyboard using given an id retrieved from GetKeyboards.
rpc DisconnectKeyboard (DisconnectKeyboardRequest) returns (DisconnectKeyboardReply) {}
// Sets the active layer of a connected keyboard.
rpc SetLayer (SetLayerRequest) returns (SetLayerReply) {}
// Unsets a previously set layer.
rpc UnsetLayer (SetLayerRequest) returns (SetLayerReply) {}
// Sets the color of a specific LED on the keyboard.
rpc SetRGBLed (SetRGBLedRequest) returns (SetRGBLedReply) {}
// Sets the color of all LEDs on the keyboard.
rpc SetRGBAll (SetRGBAllRequest) returns (SetRGBAllReply) {}
// Sets the status LED on the keyboard.
rpc SetStatusLed (SetStatusLedRequest) returns (SetStatusLedReply) {}
// Increases the brightness of the keyboard.
rpc IncreaseBrightness (IncreaseBrightnessRequest) returns (BrightnessUpdateReply) {}
// Decreases the brightness of the keyboard.
rpc DecreaseBrightness (DecreaseBrightnessRequest) returns (BrightnessUpdateReply) {}
}