Skip to content

[WIP] Refactor HID - #815

Draft
zxzxwu wants to merge 1 commit into
google:mainfrom
zxzxwu:hid
Draft

[WIP] Refactor HID#815
zxzxwu wants to merge 1 commit into
google:mainfrom
zxzxwu:hid

Conversation

@zxzxwu

@zxzxwu zxzxwu commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

- Replace legacy HID implementation with structured Message classes, Device/Host roles, and Delegate pattern from bumble_ext.
- Add DeviceSdpRecord dataclass with to_service_attributes, from_service_attributes, and find classmethods.
- Support get_idle and set_idle control messages on both Host and Device.
- Serialize concurrent Host control transactions with asyncio.Lock and abort pending futures on disconnect/malformed PDUs.
- Fix GET_REPORT buffer_size truncation to account for Report ID prefix.
- Unify EVENT_CONTROL_DATA payload format across Device and Host.
- Handle empty PDUs, truncated/malformed report requests, and reserved handshake result codes (0x05..0x0D) safely.
- Refactor run_hid_device.py and run_hid_host.py examples to use the new API.
- Add comprehensive unit test suite in tests/hid_test.py.

TAG=agy
CONV=f1437e84-a8c3-4577-abb4-c0f287986a23
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