You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extract HID functionality into transport_hid and ble_hid modules
Implemented clean architectural separation following the established transport pattern:
## New modules created:
- **transport_hid.c/h**: Pure transport bridge for BLE HID ↔ USB HID data flow
- **ble_hid.c/h**: BLE HID client implementation with protocol handling and callbacks
## Architecture improvements:
- **Separation of concerns**: Transport logic separated from protocol implementation
- **Consistent patterns**: Matches transport_uart/ble_nus architecture
- **Callback-based design**: Clean event flow between layers
- **Modular initialization**: Each module handles its own setup
## Code changes:
- Created transport_hid with bridge state management and USB forwarding
- Created ble_hid with ESP HID event handling and device lifecycle
- Refactored main.c to use callback-based architecture
- Removed duplicate helper functions (log_report, log_addr, appearance_to_string)
- Updated hidh_callback to forward events to ble_hid module
- Added proper module initialization in app_main
## Benefits:
- Cleaner code organization and maintainability
- Easier to extend with future HID features
- Consistent with existing transport_uart pattern
- Better error handling and state management
- Alphabetical file ordering (transport_hid, transport_uart)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments