Add QuietComfort Headphones (prince) support#22
Open
silverpoetry wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for Bose QuietComfort Headphones (“prince”, PID 0x4075) by extending the device catalogs/configs across Rust, Python, and C++, introducing a device-specific ModeConfig parser/builder pair (47-byte STATUS / 39-byte SETGET), and adding a fallback path that derives/updates “live” CNC/wind settings via the current editable ModeConfig when [31.10] AudioModesSettingsConfig is unavailable.
Changes:
- Add
qc_princedevice configuration and register it in catalogs/auto-detection across Rust/Python/C++. - Implement prince ModeConfig parsing/building (47-byte STATUS, 39-byte SETGET) and select builders via config.
- Add “audio settings” fallback via current ModeConfig + update CLI/docs/tests accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/main.rs | CLI: report ANC toggle as unsupported for devices without [31.10] and without an ANC toggle bit. |
| rust/src/devices.rs | Add qc_prince DeviceConfig and extend configs with mode-config builder + ANC-toggle capability flag. |
| rust/src/device.rs | Add config fields for ModeConfig builder + ANC-toggle support; add prince parser and 39-byte builder. |
| rust/src/connection.rs | Add ModeConfig-based fallback for reading/updating audio settings; select builder via device config. |
| rust/src/catalog.rs | Mark prince as supported by linking PID 0x4075 to qc_prince. |
| README.md | Document prince support and link new protocol notes; update examples/comments and device tables. |
| python/tests/test_qc_ultra2.py | Register and validate qc_prince in the Python device registry. |
| python/tests/test_device_parsers.py | Add tests for 39-byte builder and 47-byte parser behavior. |
| python/tests/test_connection.py | Add tests covering ModeConfig fallback read/write behavior for prince. |
| python/tests/test_catalog.py | Validate prince catalog lookup and support status. |
| python/pybmap/devices/qc_prince.py | New Python device config module for QuietComfort Headphones (“prince”). |
| python/pybmap/devices/parsers.py | Add parse_mode_config_47 and build_mode_config_39. |
| python/pybmap/devices/init.py | Register qc_prince and map PID 0x4075 for auto-detection. |
| python/pybmap/connection.py | Add audio_settings() accessor + ModeConfig fallback update path. |
| python/pybmap/cli.py | Use device-configured ModeConfig parser; handle ANC output for unsupported toggle devices. |
| python/pybmap/catalog.py | Mark prince as supported (config="qc_prince"). |
| docs/quietcomfort-headphones-prince.md | New protocol notes for prince (RFCOMM channel, packets, layouts, limitations). |
| docs/architecture.md | Update architecture docs to reflect builder selection and prince device characteristics. |
| cpp/tests/test_parsers.cpp | Add builder/parser tests for prince ModeConfig formats. |
| cpp/tests/test_connection.cpp | Add fallback behavior tests; extend mock transport to record sent packets. |
| cpp/tests/test_catalog.cpp | Validate prince catalog lookup and support status. |
| cpp/src/main.cpp | CLI: report ANC toggle as unsupported for devices without toggle support. |
| cpp/src/devices.h | Add qc_prince() DeviceConfig and register it in get_device(). |
| cpp/src/device.h | Add prince ModeConfig parser and 39-byte builder; add builder + ANC-toggle fields to config. |
| cpp/src/connection.h | Add ModeConfig fallback for audio settings; select builder via device config. |
| cpp/src/catalog.h | Mark prince as supported by linking PID 0x4075 to qc_prince. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+140
to
+142
| if dev.config().audio_settings.is_none() && !dev.config().supports_anc_toggle { | ||
| Ok(println!("unsupported")) | ||
| } else { |
Comment on lines
+371
to
+372
| if not self.has_feature("mode_config"): | ||
| raise BmapError("Device does not support direct audio settings") |
Comment on lines
222
to
+224
| if resp.fblock == 31 and resp.func == 6 and resp.op == pybmap.constants.OP_STATUS: | ||
| from pybmap.devices.parsers import parse_mode_config_48 | ||
| config = parse_mode_config_48(resp.payload) | ||
| parser = dev._feature("mode_config").get("parser") | ||
| config = parser(resp.payload) if parser else None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qc_princesupport for Bose QuietComfort Headphones (prince, product ID0x4075) across Python, Rust, and C++ catalogs/configs.[31.10] AudioModesSettingsConfigis not available.Notes
This is intentionally separate from QuietComfort 45 (
duran,0x4039), which remains unverified.Testing
python/.venv/Scripts/python.exe -m pytest python/tests -q->134 passed, 18 skippedgit diff --check-> clean, aside from existing line-ending warnings on Windowscargo/rustcare not installed in this Windows environment.bluetooth/bluetooth.h) and POSIXpopen/pclose, so it cannot build in this Windows environment.