Add support for Nearby/FastPair protocol (Pixel buds left/right/case report) #94
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.
This is, at least, what Google Pixel Buds use to report left, right, and case battery status. Also, extend the BatteryStateQuerier class to support returning more than one value, and I added
logging
support (mostly for my debugging convenience).I figured that out by enabling BT snoop logs on my phone. The protocol is simple, and data is sent from the headset automatically on connection (and regularly when the battery level changes). Once I figured out which UUID the channel/port corresponded to, I found out it is Google's Nearby/Fastpair protocol (https://developers.google.com/nearby/fast-pair/landing-page). The protocol documentation doesn't appear to be public, but information can be gathered from opensource code.
Only tested with Google Pixel Buds A-series. I believe some BT speakers use that protocol as well.