Repository navigation
--connected now reports a charging headset as connected - #609
Merged
Merged
Conversation
checkDeviceConnected() only treated BATTERY_AVAILABLE as connected, so --connected printed false for any headset on its charging cable. That has been the case since the C version, and applies to every device that can report BATTERY_CHARGING. The other statuses (unavailable, HID error, timeout) all mean the headset could not be talked to, so only those count as disconnected now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
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
As agreed on #580: a headset on its charging cable now counts as connected.
The other three statuses still mean disconnected, since each one means we couldn't talk to the headset:
BATTERY_UNAVAILABLE(off or not paired),BATTERY_HIDERROR,BATTERY_TIMEOUT.Evidence
Tested on a Virtuoso XT with the cable and the receiver both plugged in. This build includes #570's battery code, because master's Virtuoso code never reports charging.
0a62,BATTERY_CHARGING→--connectedprintsfalse0a62,BATTERY_CHARGING→true; receiver0a64(no headset paired) → stillfalseThe unit suite passes and the file is clean under
clang-format18.checkDeviceConnected()short-circuits for the test device, so no unit test reaches this line.Merge Danger
Door: two-way. It's a one-line revert.
Blast Radius: behavioural
This changes what
--connectedprints for all 18 device files that can reportBATTERY_CHARGING. A script that used--connectedas a "not charging" check will now gettruewhile charging. It wants a line in the release notes, and the PR title is written to serve as that line.Checklist
--connectedisn't documented beyond--help.🤖 Generated with Claude Code