Repository navigation
Read back ASTRO A50 Gen 5 headset volume - #615
Merged
Merged
Conversation
Add getHeadsetVolume() for the A50 Gen 5 (CMD 0x08 GET, level 0..21 in reply byte 8) and list CAP_HEADSET_VOLUME as readable. Replies without a payload are now skipped when polling, so a previous SET's ack isn't taken for the GET reply, and a volume reply too short to hold byte 8 is a protocol error instead of level 0. Verified on hardware: --volume reads level 9 and follows a SET to 7 and back.
Turning the volume wheel pushes 02 0c 06 00 08 00 <raw> 00 <level>, the GET reply layout with handle 0x00 (captured on hardware). A push that lands during a read is taken as the current level; document that and add a test with a captured frame.
Owner
|
Thanks. The bare-ack skip is the right call, and One residual worth knowing, not worth changing: a wheel push accepted as the GET reply leaves the real reply queued, so a turn during a read can make the next Merging. |
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.
Changes made
Reads back the ASTRO A50 Gen 5's hardware volume, using the readable-capabilities bitmask from #605. This is the read-back half of the plan agreed in #599; #600 added the setter.
getHeadsetVolume()sends the GET02 0c 03 00 08 0cand reads the level from byte 8 of the reply,02 0c 06 00 08 0c <raw> 00 <0..21>. It's mapped back to 0–128 withmapDiscreteToSidetone<22>(), so a read-back round-trips through the setter.CAP_HEADSET_VOLUMEis now in the A50'sgetReadableCapabilities().02 0c 03 00 08 1b) for the next reader, and without this a--volumeright after a--volume 64read that ack as level 0.0x00(captured on hardware). A push that lands during a read carries the current level, so it's accepted; a test pins this down with a captured frame.--readme-helper(A50 headset volumex→r).Tested on a real A50 Gen 5:
--volumereads level 9 (47), follows a SET down to level 7 (37) and back, and the wheel pushes were captured with--dev -- --receivewhile turning it both ways.The PR has two commits: the read-back itself, and the wheel-push test.
Checklist