Skip to content

Add QuietComfort Headphones (prince) support#22

Open
silverpoetry wants to merge 1 commit into
aaronsb:mainfrom
silverpoetry:add-prince-quietcomfort-support
Open

Add QuietComfort Headphones (prince) support#22
silverpoetry wants to merge 1 commit into
aaronsb:mainfrom
silverpoetry:add-prince-quietcomfort-support

Conversation

@silverpoetry

Copy link
Copy Markdown

Summary

  • Add qc_prince support for Bose QuietComfort Headphones (prince, product ID 0x4075) across Python, Rust, and C++ catalogs/configs.
  • Add the 47-byte ModeConfig STATUS parser and 39-byte ModeConfig SETGET builder used by this device.
  • Add a ModeConfig fallback for live CNC/wind updates when [31.10] AudioModesSettingsConfig is not available.
  • Document the observed protocol, including RFCOMM channel 8, mode switching packets, raw CNC scale, wind block, and unsupported ANC-off attempts.

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 skipped
  • git diff --check -> clean, aside from existing line-ending warnings on Windows
  • Rust tests were not run: cargo/rustc are not installed in this Windows environment.
  • C++ build was attempted with CMake/MSVC, but this repo's C++ target depends on Linux/BlueZ headers (bluetooth/bluetooth.h) and POSIX popen/pclose, so it cannot build in this Windows environment.

@silverpoetry silverpoetry requested a review from aaronsb as a code owner July 9, 2026 16:04
Copilot AI review requested due to automatic review settings July 9, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_prince device 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 thread rust/src/main.rs
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 thread python/pybmap/cli.py
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
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.

2 participants