Skip to content

feat: tri-mode BLE dongle - #1028

Open
HaoboGu wants to merge 1 commit into
feat/dongle-groundworkfrom
feat/dongle-core
Open

feat: tri-mode BLE dongle#1028
HaoboGu wants to merge 1 commit into
feat/dongle-groundworkfrom
feat/dongle-core

Conversation

@HaoboGu

@HaoboGu HaoboGu commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The dongle itself: a BLE central that pairs with RMK keyboards and relays them to the host over USB. HID reports are merged across links (modifiers OR'd, keycodes unioned), and the Rynk config session is routed — 0x09xx dongle commands answered locally, everything else passed through to the selected keyboard over its rynk GATT service, with topic pushes forwarded back.

  • rmk::dongle: slot table with bond persistence and Lamport-recency eviction; per-link state machine (claim → connect → secure → handshake → serve) with LESC Just Works pairing gated by an RSSI-selected 30 s pairing window; HID merge; the USB frame router.
  • Dongle::new(controller, address, slots) owns its stack, sized by DONGLE_LINKS_NUM; slots come from new_storage_for_dongle.
  • UsbTransport::with_dongle_router attaches the router. The dongle feature is orthogonal to rynk/vial: one crate can build keyboard and dongle binaries side by side (CI covers the union feature set).
  • examples/use_rust/nrf_dongle: tri-board reference — nRF54LM20A dongle, nRF52833 split central, nRF54L15 split peripheral.

Hardware-tested end to end on the tri-board rig: pairing via SwitchToDongle, typing through the split (both halves), config pass-through over USB, and bonded directed reconnect after a dongle power-cycle. Design doc included (zh + en).

Stack 4/4 — depends on #1027.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 397.6 KiB 397.6 KiB +0.01% ⬆️ +44 0 0
use_config/nrf52840_ble 439.5 KiB 439.7 KiB +0.04% ⬆️ +196 0 +16
use_config/nrf52840_ble_split (central) 500.6 KiB 500.9 KiB +0.04% ⬆️ +212 0 +16
use_config/nrf52840_ble_split (peripheral) 318.8 KiB 318.8 KiB +0.00% 0 0 0
use_config/pi_pico_w_ble 672.8 KiB 672.8 KiB +0.00% ⬇️ -36 0 +16
use_config/rp2040 146.2 KiB 146.3 KiB +0.04% ⬆️ +56 0 +16
use_config/rp2040_split (central) 159.9 KiB 160.0 KiB +0.00% ⬆️ -8 0 +16
use_config/rp2040_split (peripheral) 27.9 KiB 27.9 KiB +0.00% 0 0 0
use_config/stm32f1 62.6 KiB 62.6 KiB +0.06% ⬆️ +40 0 0
use_config/stm32h7 100.5 KiB 100.4 KiB -0.10% ⬇️ -124 0 +16
use_rust/nrf52832_ble 385.2 KiB 385.5 KiB +0.09% ⬆️ +364 0 0
use_rust/nrf52840_ble 435.1 KiB 435.2 KiB +0.03% ⬆️ +128 0 +16
use_rust/nrf52840_ble_split (central) 504.1 KiB 504.5 KiB +0.06% ⬆️ +300 0 +16
use_rust/nrf52840_ble_split (peripheral) 316.4 KiB 316.4 KiB +0.00% 0 0 0
use_rust/pi_pico_w_ble 672.2 KiB 672.3 KiB +0.00% ⬆️ +52 0 +16
use_rust/rp2040 145.6 KiB 145.6 KiB +0.00% ⬆️ -8 0 +16
use_rust/rp2040_split (central) 158.4 KiB 158.4 KiB +0.00% ⬇️ -20 0 +16
use_rust/rp2040_split (peripheral) 28.2 KiB 28.2 KiB +0.00% 0 0 0
use_rust/stm32f1 61.8 KiB 61.9 KiB +0.12% ⬆️ +76 0 0
use_rust/stm32h7 119.6 KiB 119.7 KiB +0.06% ⬆️ +68 0 +16
use_config/nrf52832_ble — 397.6 KiB → 397.6 KiB (+0.01% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 364912	   8620	  33624	 407156	  63674	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 364868	   8620	  33624	 407112	  63648	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0% +1.31Ki  [ = ]       0    .debug_str
  +0.1% +1.18Ki  [ = ]       0    .debug_info
  +0.1%    +206  [ = ]       0    .debug_line
  +0.0%     +95  [ = ]       0    .strtab
  +0.9%     +70  [ = ]       0    .debug_abbrev
  +0.0%     +44  +0.0%     +44    .text
 -24.2%     -16  [ = ]       0    [Unmapped]
  -0.1%    -112  [ = ]       0    .debug_ranges
  -0.2% -1.49Ki  [ = ]       0    .debug_loc
  +0.0% +1.28Ki  +0.0%     +44    TOTAL
use_config/nrf52840_ble — 439.5 KiB → 439.7 KiB (+0.04% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 397936	   8628	  43664	 450228	  6deb4	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 397740	   8628	  43648	 450016	  6dde0	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.72Ki  [ = ]       0    .debug_str
  +0.1% +2.31Ki  [ = ]       0    .debug_info
  +0.2% +1.68Ki  [ = ]       0    .debug_loc
  +0.2%    +440  [ = ]       0    .debug_ranges
  +0.1%    +196  +0.1%    +196    .text
  +0.0%     +85  [ = ]       0    .debug_line
  +0.0%     +58  [ = ]       0    .strtab
  +0.5%     +39  [ = ]       0    .debug_abbrev
  [ = ]       0  +0.0%     +16    .bss
  -8.2%      -4  [ = ]       0    [Unmapped]
  +0.1% +9.50Ki  +0.0%    +212    TOTAL
use_config/nrf52840_ble_split (central) — 500.6 KiB → 500.9 KiB (+0.04% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 455340	   8684	  48856	 512880	  7d370	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 455128	   8684	  48840	 512652	  7d28c	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.64Ki  [ = ]       0    .debug_str
  +0.1% +1.94Ki  [ = ]       0    .debug_info
  +0.1% +1.09Ki  [ = ]       0    .debug_loc
  +0.1%    +360  [ = ]       0    .debug_ranges
  +0.1%    +212  +0.1%    +212    .text
  +0.0%    +129  [ = ]       0    .strtab
  +0.1%     +32  [ = ]       0    .debug_frame
  +0.0%     +32  [ = ]       0    .symtab
  [ = ]       0  +0.0%     +16    .bss
  +0.0%     +16  [ = ]       0    .debug_aranges
   +28%     +13  [ = ]       0    [Unmapped]
  -0.1%    -193  [ = ]       0    .debug_line
  +0.1% +8.26Ki  +0.0%    +228    TOTAL
use_config/nrf52840_ble_split (peripheral) — 318.8 KiB → 318.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 292804	   8500	  25184	 326488	  4fb58	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 292804	   8500	  25184	 326488	  4fb58	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +13  [ = ]       0    .debug_info
  +0.0%     +10  [ = ]       0    .debug_loc
  +0.0%      +9  [ = ]       0    .debug_str
  +0.0%      +6  [ = ]       0    .debug_line
  +0.0%      +1  [ = ]       0    .strtab
  +1.8%      +1  [ = ]       0    [Unmapped]
  +0.0%     +40  [ = ]       0    TOTAL
use_config/pi_pico_w_ble — 672.8 KiB → 672.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 635264	      0	  53704	 688968	  a8348	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635300	      0	  53688	 688988	  a835c	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.72Ki  [ = ]       0    .debug_str
  +0.1% +2.20Ki  [ = ]       0    .debug_info
  +0.1%    +487  [ = ]       0    .strtab
  +0.1%    +184  [ = ]       0    .debug_ranges
  +0.1%     +36  [ = ]       0    .debug_frame
  [ = ]       0  +0.0%     +16    .bss
  +0.0%      +8  [ = ]       0    .debug_aranges
  +4.3%      +2  [ = ]       0    [Unmapped]
  -0.0%     -16  [ = ]       0    .symtab
  -0.0%     -36  -0.0%     -36    .text
  -0.0%    -203  [ = ]       0    .debug_line
  -0.7% -7.20Ki  [ = ]       0    .debug_loc
  +0.0%    +180  -0.0%     -20    TOTAL
use_config/rp2040 — 146.2 KiB → 146.3 KiB (+0.04% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135916	      0	  13908	 149824	  24940	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135860	      0	  13892	 149752	  248f8	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.2% +3.62Ki  [ = ]       0    .debug_loc
  +0.2% +3.45Ki  [ = ]       0    .debug_str
  +0.1% +1.41Ki  [ = ]       0    .debug_info
  +0.1%    +219  [ = ]       0    .debug_line
  +0.2%    +168  [ = ]       0    .debug_ranges
  +0.3%     +96  [ = ]       0    .symtab
  +0.0%     +56  +0.0%     +56    .text
  +0.0%     +25  [ = ]       0    .strtab
  [ = ]       0  +0.1%     +16    .bss
 -38.7%     -24  [ = ]       0    [Unmapped]
  +0.3% +9.00Ki  +0.0%     +72    TOTAL
use_config/rp2040_split (central) — 159.9 KiB → 160.0 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 148936	      0	  14860	 163796	  27fd4	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 148944	      0	  14844	 163788	  27fcc	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +3.21Ki  [ = ]       0    .debug_str
  +0.7% +2.58Ki  [ = ]       0    .debug_loc
  +0.1% +1.34Ki  [ = ]       0    .debug_info
  +0.2%    +216  [ = ]       0    .debug_ranges
  [ = ]       0  +0.1%     +16    .bss
  -0.0%      -8  -0.0%      -8    .text
  -0.0%     -16  [ = ]       0    .strtab
 -37.1%     -23  [ = ]       0    [Unmapped]
  -0.0%     -43  [ = ]       0    .debug_line
  +0.2% +7.25Ki  +0.0%      +8    TOTAL
use_config/rp2040_split (peripheral) — 27.9 KiB → 27.9 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0%      -4  [ = ]       0    .debug_str
  -0.0%      -4  [ = ]       0    .strtab
  -0.0%      -8  [ = ]       0    TOTAL
use_config/stm32f1 — 62.6 KiB → 62.6 KiB (+0.06% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57748	     28	   6336	  64112	   fa70	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57708	     28	   6336	  64072	   fa48	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +1.42Ki  [ = ]       0    .debug_str
  +0.2%    +957  [ = ]       0    .debug_info
  +0.4%    +174  [ = ]       0    .strtab
  +0.3%     +44  [ = ]       0    .debug_frame
  +0.1%     +40  +0.1%     +40    .text
  +0.1%     +32  [ = ]       0    .debug_ranges
  +0.2%     +32  [ = ]       0    .symtab
   +70%     +28  [ = ]       0    [Unmapped]
  +0.3%     +16  [ = ]       0    .debug_aranges
  -0.0%     -43  [ = ]       0    .debug_line
  -0.6%    -734  [ = ]       0    .debug_loc
  +0.1% +1.95Ki  +0.1%     +40    TOTAL
use_config/stm32h7 — 100.5 KiB → 100.4 KiB (-0.10% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  94440	    264	   8128	 102832	  191b0	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  94564	    264	   8112	 102940	  1921c	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +4.00Ki  [ = ]       0    .debug_str
  +0.1% +1.08Ki  [ = ]       0    .debug_info
  +0.2%    +141  [ = ]       0    .strtab
   +86%     +30  [ = ]       0    [Unmapped]
  [ = ]       0  +0.2%     +16    .bss
  -0.1%     -48  [ = ]       0    .debug_aranges
  -0.5%     -80  [ = ]       0    .debug_frame
  -0.2%    -124  -0.2%    -124    .text
  -0.8%    -224  [ = ]       0    .symtab
  -0.3%    -337  [ = ]       0    .debug_line
  -4.7% -3.24Ki  [ = ]       0    .debug_ranges
  -3.0% -5.41Ki  [ = ]       0    .debug_loc
  -0.1% -4.20Ki  -0.1%    -108    TOTAL
use_rust/nrf52832_ble — 385.2 KiB → 385.5 KiB (+0.09% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 352596	   8620	  33560	 394776	  60618	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 352232	   8620	  33560	 394412	  604ac	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0% +1.40Ki  [ = ]       0    .debug_str
  +0.1% +1.21Ki  [ = ]       0    .debug_info
  +0.1%    +381  [ = ]       0    .debug_line
  +0.1%    +364  +0.1%    +364    .text
  +0.1%    +168  [ = ]       0    .debug_ranges
  +0.0%     +28  [ = ]       0    .strtab
  +0.1%     +12  [ = ]       0    .debug_abbrev
 -16.9%     -10  [ = ]       0    [Unmapped]
  -0.1%     -24  [ = ]       0    .debug_aranges
  -0.1%     -48  [ = ]       0    .debug_frame
  -0.1%     -96  [ = ]       0    .symtab
  -0.2% -1.36Ki  [ = ]       0    .debug_loc
  +0.0% +2.00Ki  +0.1%    +364    TOTAL
use_rust/nrf52840_ble — 435.1 KiB → 435.2 KiB (+0.03% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 396144	   8628	  40904	 445676	  6ccec	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 396016	   8628	  40888	 445532	  6cc5c	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.94Ki  [ = ]       0    .debug_str
  +0.1% +2.64Ki  [ = ]       0    .debug_info
  +0.3% +2.18Ki  [ = ]       0    .debug_loc
  +0.2%    +392  [ = ]       0    .debug_ranges
  +0.1%    +306  [ = ]       0    .debug_line
  +0.0%    +128  +0.0%    +128    .text
  +0.0%     +27  [ = ]       0    .strtab
  [ = ]       0  +0.0%     +16    .bss
  -0.0%     -16  [ = ]       0    .debug_aranges
  -0.1%     -32  [ = ]       0    .debug_frame
  -0.1%     -96  [ = ]       0    .symtab
  +0.1% +10.5Ki  +0.0%    +144    TOTAL
use_rust/nrf52840_ble_split (central) — 504.1 KiB → 504.5 KiB (+0.06% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 457052	   8684	  50824	 516560	  7e1d0	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 456752	   8684	  50808	 516244	  7e094	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +4.79Ki  [ = ]       0    .debug_str
  +0.1% +1.86Ki  [ = ]       0    .debug_info
  +0.1% +1.12Ki  [ = ]       0    .debug_loc
  +0.2%    +536  [ = ]       0    .debug_ranges
  +0.1%    +300  +0.1%    +300    .text
  +0.1%    +227  [ = ]       0    .strtab
  +0.1%    +160  [ = ]       0    .symtab
  +0.2%     +96  [ = ]       0    .debug_frame
  +0.0%     +73  [ = ]       0    .debug_line
  +0.1%     +48  [ = ]       0    .debug_aranges
  [ = ]       0  +0.0%     +16    .bss
 -24.5%     -13  [ = ]       0    [Unmapped]
  +0.1% +9.17Ki  +0.1%    +316    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 316.4 KiB → 316.4 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 290540	   8500	  24952	 323992	  4f198	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 290540	   8500	  24952	 323992	  4f198	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +245  [ = ]       0    .debug_info
  +0.0%    +163  [ = ]       0    .debug_str
  +0.0%    +103  [ = ]       0    .debug_line
  +0.0%      +6  [ = ]       0    .strtab
  -2.1%      -1  [ = ]       0    [Unmapped]
  +0.0%    +516  [ = ]       0    TOTAL
use_rust/pi_pico_w_ble — 672.2 KiB → 672.3 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 635004	      0	  53384	 688388	  a8104	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 634952	      0	  53368	 688320	  a80c0	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +9.43Ki  [ = ]       0    .debug_str
  +0.1% +1.94Ki  [ = ]       0    .debug_info
  +0.3% +1.11Ki  [ = ]       0    .strtab
  +0.1%    +896  [ = ]       0    .debug_loc
  +0.0%     +52  +0.0%     +52    .text
  +0.1%     +36  [ = ]       0    .debug_frame
  [ = ]       0  +0.0%     +16    .bss
  +0.0%     +16  [ = ]       0    .symtab
  +0.0%      +8  [ = ]       0    .debug_aranges
 -25.7%     -19  [ = ]       0    [Unmapped]
  -0.0%     -44  [ = ]       0    .debug_line
  -0.1%    -264  [ = ]       0    .debug_ranges
  +0.1% +13.1Ki  +0.0%     +68    TOTAL
use_rust/rp2040 — 145.6 KiB → 145.6 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135348	      0	  13748	 149096	  24668	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135356	      0	  13732	 149088	  24660	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.2% +3.69Ki  [ = ]       0    .debug_loc
  +0.2% +3.35Ki  [ = ]       0    .debug_str
  +0.1% +1.35Ki  [ = ]       0    .debug_info
  +0.2%    +176  [ = ]       0    .debug_ranges
  +0.2%     +64  [ = ]       0    .symtab
  +0.0%     +33  [ = ]       0    .debug_line
  +0.0%     +18  [ = ]       0    .strtab
  [ = ]       0  +0.1%     +16    .bss
   +22%     +11  [ = ]       0    [Unmapped]
  -0.0%      -8  -0.0%      -8    .text
  +0.2% +8.68Ki  +0.0%      +8    TOTAL
use_rust/rp2040_split (central) — 158.4 KiB → 158.4 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 147640	      0	  14604	 162244	  279c4	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 147660	      0	  14588	 162248	  279c8	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +3.17Ki  [ = ]       0    .debug_str
  +0.5% +1.88Ki  [ = ]       0    .debug_loc
  +0.1% +1.36Ki  [ = ]       0    .debug_info
  +0.2%    +144  [ = ]       0    .debug_ranges
   +49%     +17  [ = ]       0    [Unmapped]
  [ = ]       0  +0.1%     +16    .bss
  -0.0%     -20  -0.0%     -20    .text
  -0.0%     -50  [ = ]       0    .strtab
  -0.0%     -75  [ = ]       0    .debug_line
  -0.4%    -160  [ = ]       0    .symtab
  +0.2% +6.26Ki  -0.0%      -4    TOTAL
use_rust/rp2040_split (peripheral) — 28.2 KiB → 28.2 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0%      -4  [ = ]       0    .debug_str
  -0.0%      -4  [ = ]       0    .strtab
  -0.0%      -8  [ = ]       0    TOTAL
use_rust/stm32f1 — 61.8 KiB → 61.9 KiB (+0.12% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57080	     28	   6272	  63380	   f794	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57004	     28	   6272	  63304	   f748	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +1.46Ki  [ = ]       0    .debug_str
  +0.2%    +889  [ = ]       0    .debug_info
  +0.1%    +176  [ = ]       0    .debug_loc
  +0.4%    +164  [ = ]       0    .strtab
  +0.1%     +84  [ = ]       0    .debug_line
  +0.1%     +76  +0.1%     +76    .text
  +0.2%     +64  [ = ]       0    .debug_ranges
  +0.2%     +32  [ = ]       0    .symtab
  +0.2%     +28  [ = ]       0    .debug_frame
   +50%     +20  [ = ]       0    [Unmapped]
  +0.2%      +8  [ = ]       0    .debug_aranges
  +0.2% +2.96Ki  +0.1%     +76    TOTAL
use_rust/stm32h7 — 119.6 KiB → 119.7 KiB (+0.06% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 108192	    320	  14028	 122540	  1deac	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 108124	    320	  14012	 122456	  1de58	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.2% +3.87Ki  [ = ]       0    .debug_str
  +0.1% +1.16Ki  [ = ]       0    .debug_info
  +0.2%    +144  [ = ]       0    .debug_ranges
  +0.1%    +143  [ = ]       0    .debug_line
  +0.1%     +68  +0.1%     +68    .text
  +0.1%     +32  [ = ]       0    .symtab
  +0.0%     +21  [ = ]       0    .strtab
  [ = ]       0  +0.1%     +16    .bss
  +0.1%     +16  [ = ]       0    .debug_frame
  +0.0%      +8  [ = ]       0    .debug_aranges
 -10.7%      -6  [ = ]       0    [Unmapped]
  -0.1%    -325  [ = ]       0    .debug_loc
  +0.1% +5.13Ki  +0.1%     +84    TOTAL

@HaoboGu
HaoboGu force-pushed the feat/dongle-core branch 2 times, most recently from 0667f5d to f7478fd Compare August 4, 2026 12:37
@HaoboGu
HaoboGu force-pushed the feat/dongle-core branch 2 times, most recently from 1637b06 to 9faaf4b Compare August 5, 2026 06:54
@HaoboGu
HaoboGu force-pushed the feat/dongle-core branch 2 times, most recently from 15955c2 to af7c0d3 Compare August 5, 2026 08:52
A dongle is a BLE central that pairs with RMK keyboards and relays them to
the host over USB: HID reports are merged across links (modifiers OR'd,
keycodes unioned), and the Rynk config session is routed — 0x09xx dongle
commands answered locally, everything else passed through to the selected
keyboard over its rynk GATT service, with topic pushes forwarded back.

- `rmk::dongle`: slot table with bond persistence and Lamport-recency
  eviction, per-link state machine (claim → connect → secure → handshake →
  serve; LESC Just Works with an RSSI-selected pairing window), HID merge,
  and the CDC frame router.
- `Dongle::new(controller, address, slots)` owns its stack, sized by
  `DONGLE_LINKS_NUM`; slots come from `new_storage_for_dongle`.
- `UsbTransport::with_dongle_router` attaches the router; the `dongle`
  feature is orthogonal to `rynk`/`vial`, so one crate can build keyboard
  and dongle binaries side by side.
- `examples/use_rust/nrf_dongle`: a tri-board reference (nRF54LM20A dongle,
  nRF52833 split central, nRF54L15 split peripheral), hardware-tested:
  pairing, typing through the split, config pass-through, and bonded
  directed reconnect after a dongle power-cycle.
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