Files
KeyBoard_QT/docs/host_dri_rebuild.md

71 lines
1.4 KiB
Markdown
Raw Normal View History

2026-04-11 09:31:49 +08:00
# 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
2026-04-11 10:42:13 +08:00
Implemented behavior:
- keep the same surface shape as CDC:
- `Enum`
- `Open`
- `Close`
- `ReadBytes`
- `WriteBytes`
- stay transport-only
- keep real BLE implementation for a later node
2026-04-11 09:31:49 +08:00
### 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