Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio RPC Infrastructure #2254

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

petejohanson
Copy link
Contributor

Initial PR for the RPC infrastructure to be used by ZMK Studio.

This includes the behavior metadata commit from #2231 as it's used by the first really fleshed out behavior subsystem.

To Do

  • Document framing and protocol buffer messages.
  • Wrap up the sample client library.
  • Testing/validation from others.

@petejohanson petejohanson added enhancement New feature or request studio ZMK Studio (runtime keymaps) labels Apr 5, 2024
@petejohanson petejohanson self-assigned this Apr 5, 2024
@petejohanson petejohanson requested a review from a team as a code owner April 5, 2024 18:36
@petejohanson petejohanson force-pushed the studio/rpc-infrastructure branch 3 times, most recently from a873cb3 to d79d916 Compare April 10, 2024 20:55
@petejohanson petejohanson force-pushed the studio/rpc-infrastructure branch 2 times, most recently from 377f159 to 13a6e9e Compare April 18, 2024 03:51
* For upcoming ZMK studio work, make a set of rich metadata available
  to provide a friendly name for a behavior, and allow super flexible
  descriptions of the parameters the behaviors take.
* Used for ZMK Studio even remappers to be sure the one
  RPC event listener subscribes to their mapped events.
* Add a new feature for tracking a given behavior by a new concept
  of a "behavior local ID" which is a stable 16-bit identifier for
  a given behavior, that is resilient to new behaviors being added
  and requires no additional work on the part of the behavior
  authors.
* Add implementations for either settings lookup table, or CRC16
  hashing of behavior device names for generating behavior local
  IDs.
* UART and BLE/GATT transports for a protobuf encoded RPC
  request/response protocol.
* Custom framing protocol is used to frame a give message.
* Requests/responses are divided into major "subsystems" which
  handle requests and create response messages.
* Notification support, including mapping local events to RPC
  notifications by a given subsystem.
* Meta responses for "no response" and "unlock needed".
* Initial basic lock state support in a new core section, and allow specifying
  if a given RPC callback requires unlocked state or not.
* Add behavior subsystem with full metadata support and examples of
  using callback to serialize a repeated field without extra stack space needed.
 * Add an easy snippet for enabling USB UART added
   to the `zephyr_udc0` standard node.
@and-elf
Copy link

and-elf commented May 28, 2024

Why not start with a cli tool, that handles the actual rpc calls, and layer studio gui ontop of it later?
I'm not sure the gui (library) should be a part of this repo.
The binary could be used by https://github.com/nickcoutsos/keymap-editor

I'm not a maintainer, but it seems to me that the software isn't a part of the firmware.
When I do RPC, I usually keep protocol definitions in an own repo, which server and client references.

@petejohanson petejohanson force-pushed the studio/rpc-infrastructure branch 2 times, most recently from 800011c to f4144f8 Compare June 2, 2024 21:34
* Implement message framing.
* Transports over Web Bluetooth/Serial.
* Message types for serialize/deserialize generated with protoc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request studio ZMK Studio (runtime keymaps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants