support windows (using Bumble) for hearing aid
Quoting bumble's docs:
To use a Bluetooth USB dongle on Windows, you need a USB dongle that does not require a vendor Windows driver (the dongle will be used directly through the WinUSB driver rather than through a vendor-supplied Windows driver).
Run with python windows/hearing-aid.py [AirPods' MAC]. You will have to re-pair your AirPods with windows later.
Summary by CodeRabbit
-
New Features
- Added a new hearing aid accessory controller application with Bluetooth support
- Comprehensive controls for listening mode, amplification, equalization, tone, ambient noise reduction, conversation boost, and own-voice amplification
- Channel-specific balance adjustments and reset functionality for hearing aid settings
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
Adds a Windows-only PyQt5 hearing aid control app with binary settings parsing, ATT/AACP protocol managers, Bumble BR/EDR transport scaffolding, and an application lifecycle that links UI actions to device reads/writes and control commands.
Changes
| Cohort / File(s) | Summary |
|---|---|
Hearing Aid Control Application windows/hearing-aid.py |
New file implementing: data model (HearingAidSettings), binary parser (parse_hearing_aid_settings), protocol managers (ATTManager, AACPManager), PyQt5 UI (HearingAidApp, SignalEmitter), Bumble transport setup (run_bumble), async/thread lifecycle, logging, and main entry point. |
Sequence Diagram
sequenceDiagram
participant User
participant UI as HearingAidApp (PyQt5)
participant ATT as ATTManager
participant AACP as AACPManager
participant Bumble as Bumble Transport
participant Device as Hearing Aid Device
rect rgb(200,230,255)
User->>UI: Launch app
UI->>Bumble: start/run_bumble
Bumble->>Device: BR/EDR connect & encrypt
Bumble->>ATT: open ATT L2CAP (PSM 31)
Bumble->>AACP: open AACP L2CAP (PSM 4097)
end
rect rgb(230,255,230)
UI->>ATT: Read settings
ATT->>Device: ATT Read
Device->>ATT: Settings (binary)
ATT->>UI: parse_hearing_aid_settings -> update UI
end
rect rgb(255,245,220)
User->>UI: Change control (EQ/amp/toggles)
UI->>UI: debounce
UI->>ATT: ATT Write (or) UI->>AACP: AACP Control Command
ATT/AACP->>Device: send update
Device->>ATT/AACP: notification/ack
ATT/AACP->>UI: emit signals -> update UI
end
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~50 minutes
- Inspect binary parsing (
parse_hearing_aid_settings) for bounds checks, endianness, and correct derived calculations (amplification, balance). - Verify ATT/AACP handshake, opcode handling, and CCCD/read/write flows in
ATTManager/AACPManager. - Review async/thread interaction between asyncio background Bumble flow and PyQt main thread (signal emission and shutdown).
- Check resource cleanup: channel closing, listener deregistration, and UI closeEvent behavior.
Poem
🐰 I hopped in code with gentle care,
knobs for tone and EQ to share,
ATT and AACP in tune,
Bumble hums a Bluetooth tune,
This rabbit cheers — your hearing's fair!
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The pull request title 'windows: add hearing aid script' accurately and concisely describes the main change—adding a new hearing aid control script for Windows. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
windows/hearing-aid
Comment @coderabbitai help to get the list of available commands and usage tips.