[feat](trx-core): add virtual channel bandwidth control
Add virtual-channel bandwidth control to the shared core API and audio protocol constants for client/server coordination. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -59,6 +59,9 @@ pub const AUDIO_MSG_VCHAN_REMOVE: u8 = 0x11;
|
||||
/// Server → client: a virtual channel was destroyed server-side (e.g. went out of bandwidth).
|
||||
/// Payload: 16-byte UUID of the destroyed channel.
|
||||
pub const AUDIO_MSG_VCHAN_DESTROYED: u8 = 0x12;
|
||||
/// Client → server: update the audio filter bandwidth of an existing virtual channel.
|
||||
/// Payload: JSON `{"uuid": "<uuid>", "bandwidth_hz": <u32>}`.
|
||||
pub const AUDIO_MSG_VCHAN_BW: u8 = 0x13;
|
||||
|
||||
/// Maximum payload size for normal messages (1 MB).
|
||||
const MAX_PAYLOAD_SIZE: u32 = 1_048_576;
|
||||
|
||||
@@ -95,6 +95,9 @@ pub trait VirtualChannelManager: Send + Sync {
|
||||
/// Update the demodulation mode of an existing channel.
|
||||
fn set_channel_mode(&self, id: Uuid, mode: &RigMode) -> Result<(), VChanError>;
|
||||
|
||||
/// Update the audio filter bandwidth of an existing channel.
|
||||
fn set_channel_bandwidth(&self, id: Uuid, bandwidth_hz: u32) -> Result<(), VChanError>;
|
||||
|
||||
/// Subscribe to decoded PCM audio from a channel.
|
||||
/// Returns `None` if the channel UUID does not exist.
|
||||
fn subscribe_pcm(&self, id: Uuid) -> Option<broadcast::Receiver<Vec<f32>>>;
|
||||
|
||||
Reference in New Issue
Block a user