Files
KeyBoard_QT/docs/host_dri_rebuild.md
2026-04-11 09:31:49 +08:00

1.2 KiB

Host DRI Rebuild

Goal

Keep the device runtime layer small and transport-only.

The DRI layer should:

  • enumerate endpoints
  • open and close connections
  • read raw bytes
  • write raw bytes

The DRI layer should not:

  • parse frames
  • manage protocol state
  • decide handshake success

Completed Nodes

Node 1: GATT placeholder

Files:

  • KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.h
  • KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.cpp

Design notes:

  • reserves the BLE transport position early
  • keeps the implementation small for now
  • avoids mixing GATT transport with logic concerns

Node 2: CDC transport cleanup

Files updated in this step:

  • KeyBorad/KeyBorad/DRI/Dri_Cdc.h
  • KeyBorad/KeyBorad/DRI/Dri_Cdc.cpp

Design notes:

  • remove frame parsing from the driver
  • remove handshake ownership from the driver
  • keep only enumerate/open/close/read-bytes/write-bytes

Implemented behavior:

  • list ports with Dri_Cdc_Enum()
  • open one port with Dri_Cdc_Open()
  • close one port with Dri_Cdc_Close()
  • read raw bytes with timeout
  • write raw bytes with timeout

Next DRI nodes

  • implement real GATT discovery and notify/write path
  • provide one simple connection summary for logic layer