Skip to content

Implement RMK protocol ICD types#772

Open
HaoboGu wants to merge 42 commits intomainfrom
feat/postcard_icd
Open

Implement RMK protocol ICD types#772
HaoboGu wants to merge 42 commits intomainfrom
feat/postcard_icd

Conversation

@HaoboGu
Copy link
Copy Markdown
Owner

@HaoboGu HaoboGu commented Mar 17, 2026

Add the complete Interface Control Document (ICD) for the RMK protocol in rmk-types/src/protocol/rmk.rs. This defines the shared type contract between firmware and host for the new postcard-rpc based communication protocol.

@HaoboGu HaoboGu mentioned this pull request Mar 17, 2026
@github-actions

This comment was marked as outdated.

HaoboGu and others added 2 commits March 17, 2026 16:44
… topics

Add the complete Interface Control Document (ICD) for the RMK protocol in
rmk-types/src/protocol/rmk.rs. This defines the shared type contract between
firmware and host for the new postcard-rpc based communication protocol.

- Add heapless v0.9 dependency with serde support and postcard-schema
  heapless-v0_9 feature for schema derives on Vec-containing types
- Define 30+ protocol types: ProtocolVersion, DeviceCapabilities, RmkError,
  LockStatus, UnlockChallenge, KeyPosition, BulkRequest, StorageResetMode,
  ConnectionType, BatteryStatus, MacroInfo/Data, ComboConfig, MorseConfig,
  ForkConfig, BehaviorConfig, topic payloads, and request wrappers
- Declare 41 endpoints across System, Keymap, Encoder, Macro, Combo, Morse,
  Fork, Behavior, Connection, and Status categories
- Declare 8 topics for layer, WPM, battery, BLE, connection, sleep, and LED
- Add 29 tests: postcard serde round-trips and key hash collision detection
- Add PartialEq/Eq derives to EncoderAction for protocol type compatibility
- Mark Phase 1 complete in ROADMAP.md
…types

Derive `postcard_schema::Schema` for enums (HidKeyCode, SpecialKey,
KeyCode, ConsumerKey, SystemControlKey) and add manual Schema impls
for bitfield structs (ModifierCombination, LedIndicator) to fix build
errors after rebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from 020d03d to 3d1e50c Compare March 17, 2026 08:49
HaoboGu and others added 14 commits March 18, 2026 15:37
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
…yload conversions

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…tus usage, fix wrong naming

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…tatus struct

Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
- Fix battery_state → battery_status in rmk-types/build.rs
- Add manual Schema impl for MouseButtons (bitfield struct)
- Fix vial_lock → host_security in matrix.rs
- Fix MatrixState::new() → MatrixState::new(ROW, COL) in keymap.rs
- Remove duplicate Mutex import in ble/mod.rs
- Remove unused BleStatusChangeEvent import in ble/profile.rs
- Apply rustfmt formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from d050d60 to 2e52e36 Compare March 18, 2026 10:49
…::action

Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from 8e5756f to 7f973f6 Compare March 18, 2026 14:36
HaoboGu added 3 commits March 18, 2026 22:46
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 28, 2026

Deploying rmk-rs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43b0a50
Status: ✅  Deploy successful!
Preview URL: https://92bc1f69.rmk-4a2.pages.dev
Branch Preview URL: https://feat-postcard-icd.rmk-4a2.pages.dev

View logs

@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from 0642aca to c0f098d Compare March 28, 2026 16:17
HaoboGu added 2 commits March 31, 2026 11:07
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from 4a0097b to 6226baf Compare March 31, 2026 10:47
HaoboGu added 14 commits March 31, 2026 19:07
Signed-off-by: Haobo Gu <haobogu@outlook.com>
  - Remove SplitStatus, use per-peripheral query (GetPeripheralStatus)
  - Add offset-based chunked access for MacroData (GetMacroRequest)
  - Add MaxSize to all protocol types (manual impls for heapless 0.9 Vec types)
  - Make heapless optional, gated behind rmk_protocol feature
  - Increase MAX_MATRIX_BITMAP_SIZE from 30 to 32
  - Document BulkRequest.count row-major semantics

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…ransfer

  - Move Fork, Morse, MorsePattern, ComboConfig to rmk-types as single source of truth
  - Delete duplicate protocol types: ForkConfig, MorseConfig, MorsePatternEntry
  - Fix bug: protocol morse entries used KeyAction instead of Action
  - Feature-gate bulk transfer endpoints behind `bulk` feature
  - Rename PROTOCOL_MAX_BULK to PROTOCOL_MAX_BULK_SIZE
  - Separate host/firmware constant generation in build.rs
  - Add bulk_transfer_supported to DeviceCapabilities
  - Make heapless a non-optional dependency of rmk-types

Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
…r sizes

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…figs

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…and morse

Signed-off-by: Haobo Gu <haobogu@outlook.com>
…nd docs

Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
… endpoint paths

Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from f2de061 to b22ce99 Compare April 6, 2026 06:58
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from cce53c1 to aa6f75b Compare April 7, 2026 12:32
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from aa6f75b to 4c40ef5 Compare April 7, 2026 12:33
Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch 2 times, most recently from 0373ec8 to c9dca09 Compare April 8, 2026 02:20
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 354.8 KiB 355.0 KiB +0.04% ⬆️ +32 0 +128
use_config/nrf52840_ble 405.5 KiB 406.7 KiB +0.29% ⬆️ +636 0 +608
use_config/nrf52840_ble_split (central) 482.0 KiB 482.8 KiB +0.15% ⬆️ +624 0 +128
use_config/nrf52840_ble_split (peripheral) 305.2 KiB 305.3 KiB +0.05% ⬆️ +156 0 +8
use_config/pi_pico_w_ble 645.2 KiB 645.3 KiB +0.01% ⬆️ -16 0 +128
use_config/rp2040 146.2 KiB 146.2 KiB +0.02% ⬆️ -88 0 +128
use_config/rp2040_split (central) 157.3 KiB 157.1 KiB -0.13% ⬇️ -352 0 +128
use_config/rp2040_split (peripheral) 25.9 KiB 26.1 KiB +0.52% ⬆️ +132 0 +8
use_config/stm32f1 63.4 KiB 63.6 KiB +0.21% ⬆️ +12 0 +128
use_config/stm32h7 100.5 KiB 100.9 KiB +0.41% ⬆️ +296 0 +128
use_rust/nrf52832_ble 344.0 KiB 343.8 KiB -0.04% ⬇️ -296 0 +128
use_rust/nrf52840_ble 402.8 KiB 402.9 KiB +0.02% ⬆️ -20 0 +128
use_rust/nrf52840_ble_split (central) 492.7 KiB 493.1 KiB +0.09% ⬆️ +364 0 +128
use_rust/nrf52840_ble_split (peripheral) 302.1 KiB 302.2 KiB +0.04% ⬆️ +120 0 +8
use_rust/pi_pico_w_ble 645.5 KiB 645.5 KiB +0.01% ⬆️ -40 0 +128
use_rust/rp2040 146.5 KiB 146.5 KiB +0.02% ⬆️ -96 0 +128
use_rust/rp2040_split (central) 156.8 KiB 156.7 KiB -0.05% ⬇️ -216 0 +128
use_rust/rp2040_split (peripheral) 26.5 KiB 26.6 KiB +0.53% ⬆️ +136 0 +8
use_rust/stm32f1 63.1 KiB 63.5 KiB +0.55% ⬆️ +228 0 +128
use_rust/stm32h7 120.3 KiB 119.5 KiB -0.58% ⬇️ -852 0 +128
use_config/nrf52832_ble — 354.8 KiB → 355.0 KiB (+0.04% ⬆️)
use_config/nrf52840_ble — 405.5 KiB → 406.7 KiB (+0.29% ⬆️)
use_config/nrf52840_ble_split (central) — 482.0 KiB → 482.8 KiB (+0.15% ⬆️)
use_config/nrf52840_ble_split (peripheral) — 305.2 KiB → 305.3 KiB (+0.05% ⬆️)
use_config/pi_pico_w_ble — 645.2 KiB → 645.3 KiB (+0.01% ⬆️)
use_config/rp2040 — 146.2 KiB → 146.2 KiB (+0.02% ⬆️)
use_config/rp2040_split (central) — 157.3 KiB → 157.1 KiB (-0.13% ⬇️)
use_config/rp2040_split (peripheral) — 25.9 KiB → 26.1 KiB (+0.52% ⬆️)
use_config/stm32f1 — 63.4 KiB → 63.6 KiB (+0.21% ⬆️)
use_config/stm32h7 — 100.5 KiB → 100.9 KiB (+0.41% ⬆️)
use_rust/nrf52832_ble — 344.0 KiB → 343.8 KiB (-0.04% ⬇️)
use_rust/nrf52840_ble — 402.8 KiB → 402.9 KiB (+0.02% ⬆️)
use_rust/nrf52840_ble_split (central) — 492.7 KiB → 493.1 KiB (+0.09% ⬆️)
use_rust/nrf52840_ble_split (peripheral) — 302.1 KiB → 302.2 KiB (+0.04% ⬆️)
use_rust/pi_pico_w_ble — 645.5 KiB → 645.5 KiB (+0.01% ⬆️)
use_rust/rp2040 — 146.5 KiB → 146.5 KiB (+0.02% ⬆️)
use_rust/rp2040_split (central) — 156.8 KiB → 156.7 KiB (-0.05% ⬇️)
use_rust/rp2040_split (peripheral) — 26.5 KiB → 26.6 KiB (+0.53% ⬆️)
use_rust/stm32f1 — 63.1 KiB → 63.5 KiB (+0.55% ⬆️)
use_rust/stm32h7 — 120.3 KiB → 119.5 KiB (-0.58% ⬇️)

Signed-off-by: Haobo Gu <haobogu@outlook.com>
@HaoboGu HaoboGu force-pushed the feat/postcard_icd branch from ef019bb to 43b0a50 Compare April 10, 2026 10:44
Signed-off-by: Haobo Gu <haobogu@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant