Skip to content

2.34.0: Bluetooth levels live, case % kept, nearby earbuds - #75

Merged
rajhansgithub merged 2 commits into
mainfrom
claude/bt-live
Dec 2, 2026
Merged

rajhansgithub merged 2 commits into
mainfrom
claude/bt-live

Conversation

@rajhansgithub

Copy link
Copy Markdown
Owner

Requested by Rajhans · project thread

What

  • Sony (WF-C710N had no level): reads the support list (06 00) and asks the battery types the model has. Newer set-2 models answer only the threshold types 9 / 10 / 8. Channel opened for every connected Sony device, asked every 20 s (changes arrive as notifications in between).
  • Case % stays: earbuds report the case only while a bud is in it. The reader keeps each device's last levels with their time (levels_at, case_at, saved in the device list, fields 18 / 19). Page says "case 20 min ago" / "Last read 2 h ago"; old numbers drawn dim.
  • Nearby devices: mod_bluetooth.exe also decodes the Google Fast Pair battery field (service data 0xFE2C, 1 % steps) and runs whenever the Bluetooth reader is active, paired or not. Fast Pair buds with the same L / R as a connected device add their case to it; unmatched readings are listed last as "Nearby". A lone unknown Apple model goes onto the paired AirPods only at >= -60 dBm.
  • Refresh: Bluetooth page every 5 s (overview 15 s). Slow-read log threshold 3 s (a sleeping Logitech mouse alone takes 0.5-2 s).
  • Diagnostics: mod_bluetooth.exe --scan [s] dumps every advertisement; --bt-debug section 9 runs it for 20 s; Sony probe shows the support list and every battery type.

Decimals: no device sends them (Sony, Logitech, Fast Pair whole %, Apple 10 % steps).

Verified on Rajhans's PC (local build of 32703d7)

  • cargo test --release: 463 passed, 0 failed.
  • --bt-watch: WF-C710N L 40 / R 40 / case 100 (was blank), MX Master 4 75, AirPods Pro (not connected) R 85 / case 95 from BLE.
  • --scan: WF-C710N's Fast Pair advert decoded L 40 / R 40.

Generated by Claude Code

- Sony: read the support list and ask the battery types the model has
  (set 2 threshold types 9 / 10 / 8: WF-C710N answered none of 1 / 2 / 0).
  Channel open for every connected Sony device, asked every 20 s.
- Last levels kept per device with their time; case level kept while
  both buds are out of the case. Saved across restarts.
- Helper module: Google Fast Pair battery field (1 % steps) next to
  Apple's; runs whenever the Bluetooth page reads, paired or not.
  Unpaired devices heard nearby are listed last.
- --scan mode in mod_bluetooth.exe and a section 9 in --bt-debug.
- Page re-read every 5 s (overview 15 s).
@rajhansgithub rajhansgithub self-assigned this Dec 2, 2026
@rajhansgithub
rajhansgithub merged commit d0527e3 into main Dec 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants