aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Johanson <[email protected]>2024-02-19 08:48:20 +0000
committerPete Johanson <[email protected]>2024-08-15 11:45:18 -0600
commitfeda96eb40f66440143e2dcfa26b5fcac6f38f33 (patch)
treebeabac37cf220e3a64156a2503f9e61a23aa2d94 /app/CMakeLists.txt
parentea64fcaf71279d9a718265653c98d7c80a51d252 (diff)
downloadzmk-feda96eb40f66440143e2dcfa26b5fcac6f38f33.tar.gz
zmk-feda96eb40f66440143e2dcfa26b5fcac6f38f33.zip
feat(studio): Initial RPC infrastructure and subsystems.
* 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. Co-authored-by: Cem Aksoylar <[email protected]>
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r--app/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 5e19713a11..afc0431b68 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -105,4 +105,27 @@ target_sources(app PRIVATE src/main.c)
add_subdirectory(src/display/)
add_subdirectory_ifdef(CONFIG_SETTINGS src/settings/)
+if (CONFIG_ZMK_STUDIO_RPC)
+ # For some reason this is failing if run from a different sub-file.
+ list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)
+
+ include(nanopb)
+
+ # Turn off the default nanopb behavior
+ set(NANOPB_GENERATE_CPP_STANDALONE OFF)
+
+ nanopb_generate_cpp(proto_srcs proto_hdrs RELPATH ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}
+ ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/studio.proto
+ ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/meta.proto
+ ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/core.proto
+ ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/behaviors.proto
+ ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/keymap.proto
+ )
+
+ target_include_directories(app PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
+ target_sources(app PRIVATE ${proto_srcs} ${proto_hdrs})
+
+ add_subdirectory(src/studio)
+endif()
+
zephyr_cc_option(-Wfatal-errors)