Repository navigation
android: Add UV-Pro Bluetooth audio session - #111
Merged
punk-kaos merged 2 commits intoOct 17, 2026
Merged
Conversation
The BTECH UV-Pro carries its audio over Bluetooth as 32 kHz mono SBC, and Android has no public SBC codec. Add a mono 8-subband encoder and decoder, ported from HTCommander's Apache-2.0 SBC code (which follows libsbc), with unit tests. Not used yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect to the radio's "BS AOC" RFCOMM audio service, decode received SBC audio, and send transmit audio. The radio only streams audio while an app is also connected on its control channel, so a device-info request is sent there first. It has no PTT command: it keys on incoming audio and unkeys on an end-of-audio frame. Transmit audio is dropped unless PTT is armed, and a 45 s watchdog releases it. Protocol details from HTCommander and benlink. Not wired in yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part 2 of 3 for #62. Stacked on #110, so please review only the last commit.
Claude Code (Claude Opus 5.5) wrote this under my direction. I didn't write it and haven't reviewed it line by line, but I went through every change with Claude, I can explain what each part does, and I did all the hardware testing myself.
What
UvProSession is the link to the radio, modelled on QmxCatSession.
It sends a device-info request on the radio's control channel, then opens the audio channel. The radio won't stream audio until the first step is done; I found that on hardware.
Transmit: the radio has no PTT command. It keys when audio arrives and unkeys on an end-of-audio frame. Audio is dropped unless PTT is armed, and a 45 s watchdog releases PTT.
Receive: silence fills the gaps while the squelch is closed, so the engine's timing holds.
The protocol details come from HTCommander and benlink (both Apache-2.0); the code was written fresh. It needs only BLUETOOTH_CONNECT.
Test
Unit tests cover the framing, with no new warnings. Used on air in PR 3.