forked from zmkfirmware/zmk
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move studio RPC to nanopb messages.
* Protocol Buffers are way more widely supported CBOR with CDDL, so switch to that message encoding.
- Loading branch information
1 parent
03011e7
commit a55de93
Showing
14 changed files
with
246 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
zmk.behaviors.list_all_behaviors_response.behaviors max_count:20 | ||
zmk.behaviors.get_behavior_details_response.friendly_name max_size:20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
syntax = "proto3"; | ||
|
||
package zmk.behaviors; | ||
|
||
message request { | ||
oneof request_type { | ||
bool list_all_behaviors = 1; | ||
get_behavior_details_request get_behavior_details = 2; | ||
} | ||
} | ||
|
||
message get_behavior_details_request { | ||
uint32 behavior_id = 1; | ||
} | ||
|
||
message response { | ||
oneof response_type { | ||
list_all_behaviors_response list_all_behaviors = 1; | ||
get_behavior_details_response get_behavior_details = 2; | ||
} | ||
} | ||
|
||
message list_all_behaviors_response { | ||
repeated uint32 behaviors = 1; | ||
} | ||
|
||
message get_behavior_details_response { | ||
uint32 id = 1; | ||
string friendly_name = 2; | ||
behavior_binding_parameter_details param1 = 3; | ||
behavior_binding_parameter_details param2 = 4; | ||
} | ||
|
||
message behavior_binding_parameter_details { | ||
behavior_binding_parameter_domain domain = 1; | ||
string name = 2; | ||
} | ||
|
||
enum behavior_binding_parameter_domain { | ||
Nil = 0; | ||
HIDUsage = 1; | ||
LayerIndex = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
syntax = "proto3"; | ||
|
||
package zmk.core; | ||
|
||
message request { | ||
oneof request_type { | ||
bool get_lock_status = 1; | ||
bool unlock_request = 2; | ||
bool lock_request = 3; | ||
} | ||
} | ||
|
||
message get_lock_status_response { | ||
bool locked = 1; | ||
} | ||
|
||
message response { | ||
oneof response_type { | ||
get_lock_status_response get_lock_status = 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
syntax = "proto3"; | ||
|
||
package zmk.keymap; | ||
|
||
message request { | ||
oneof request_type { | ||
bool get_layer_summaries = 1; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Requests | ||
syntax = "proto3"; | ||
|
||
package zmk; | ||
|
||
import "core.proto"; | ||
import "behaviors.proto"; | ||
import "keymap.proto"; | ||
|
||
message Request { | ||
uint32 request_id = 1; | ||
|
||
oneof subsystem { | ||
zmk.core.request core = 2; | ||
zmk.keymap.request keymap = 3; | ||
zmk.behaviors.request behaviors = 4; | ||
} | ||
} | ||
|
||
|
||
// keymap_request = { | ||
// (0: get_layers_summary) | ||
// } | ||
|
||
// behavior_request = { | ||
// (0: list_all_behaviors) / | ||
// (1: get_behavior_details) | ||
// } | ||
|
||
// get_layers_summary = nil | ||
|
||
// list_all_behaviors = nil | ||
// get_behavior_details = [ behavior_id: uint ] | ||
|
||
// ; Responses | ||
|
||
message Response { | ||
oneof type { | ||
RequestResponse request_response = 1; | ||
Notification notification = 2; | ||
} | ||
} | ||
|
||
message RequestResponse { | ||
uint32 request_id = 1; | ||
oneof subsystem { | ||
zmk.core.response core = 2; | ||
zmk.behaviors.response behaviors = 4; | ||
} | ||
} | ||
|
||
message Notification { | ||
uint32 notification_type = 1; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.