Device: Improve debug logs for AirPods info packets#488
Merged
Conversation
Diagnostic-only NUL-delimited UTF-8 segmentation of the 0x1D INFORMATION packet, logged at INFO so it lands in debug recordings via the existing FileLogger pipeline. The production decode path stays untouched — this only adds visibility, no behavior change. Refs #173.
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
No user-facing behavior change.
Groundwork for #173 (engraving message). When a debug recording is active, capod now dumps the structured contents of the AirPods info packet (the one sent right after a connection is established) into the log file. This includes non-ASCII bytes, so emoji or non-Latin engravings would be visible. The intent is that testers with engraved AirPods can attach a debug log so the protocol can be analyzed for where (or whether) Apple's engraving message lives.
Technical Context
parseNullTerminatedStrings: the production parser is ASCII-only (0x20..0x7E) and would silently drop emoji or non-Latin engravings. The diagnostic helper uses strict UTF-8 with a hex fallback so any encoding survives. The production decode path is intentionally untouched — no widening of protocol assumptions for a debug-only purpose.decodeDeviceInfosucceeds — an engraving-shaped packet that the strict decoder rejects still needs to be captured.name,modelNumber,manufacturer,serialNumber,firmwareVersion, then unknown). The encrypted blob lands as a 44-byte non-UTF-8 segment because there is no NUL between it and the following manufacturing-date string on the wire.decodeDeviceInfosuccess").Refs #173.