Device: Fix AirPods showing up twice after opening the case#609
Merged
Conversation
AirPods Gen4 emit a one-off type 0x07 frame from their identity address on connect whose payload prefix is 0x07 instead of 0x01. Its bytes are not the plaintext status format, but the model bytes happen to match, so it minted a fresh device tracker and showed as a duplicate device card until the stale timeout. Every known plaintext status broadcast (including pairing mode) uses prefix 0x01; pairing state lives in the suffix byte. Reject anything else at the decoder, logging the dropped frame's hex. Fixes #603
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.
What changed
Fixed AirPods appearing as two device cards for ~10–20 seconds when taking them out of the case. The duplicate showed wrong battery values and disappeared again on its own.
Closes #603
Technical Context
0x07instead of0x01. The model bytes happen to sit at the usual offset so it passed model matching, but the rest of the payload is not the plaintext status format (battery nibbles 13/14, invalid color) — it minted a fresh device tracker that matched the same profile and rendered as a second card until the 20 s stale timeout.0x01, and pairing/connection state is encoded in the payload suffix byte, not the prefix.