format specs, thinking of format specs, uh other things,

This commit is contained in:
TerraMaster85 2024-12-14 17:42:55 -05:00
parent cf99912ffe
commit e6455ce36f
6 changed files with 43 additions and 15 deletions

View file

@ -7,7 +7,7 @@ use log::{error, info, trace, warn};
use tokio::sync::mpsc::Sender;
use crate::msg::PcmFrameMessage;
use crate::task_msg::PcmFrameMessage;
pub fn audio_receiver_main(
tx_for_demod: Sender<PcmFrameMessage>,
@ -91,7 +91,7 @@ pub fn audio_receiver_main(
None,
)?,
sample_format => {
Err(anyhow::Error::msg(
Err(anyhow::Error::task_msg(
format!(
"unsupported sample format '{}'", sample_format)
))?

View file

@ -4,7 +4,7 @@ use log::{error, info, trace, warn};
use tokio::sync::mpsc::{Receiver, UnboundedSender};
use crate::msg::{RawIpDataMessage, PcmFrameMessage};
use crate::task_msg::{RawIpDataMessage, PcmFrameMessage};
pub async fn dsp_inb_main(
tx_for_ip_inb: UnboundedSender<RawIpDataMessage>,

View file

@ -14,8 +14,8 @@ use tokio::sync::mpsc::{channel, unbounded_channel};
//use ringbuf::
mod msg;
use crate::msg::{PcmFrameMessage, RawIpDataMessage};
mod task_msg;
use crate::task_msg::{PcmFrameMessage, RawIpDataMessage};
mod audio_receiver;
use crate::audio_receiver::audio_receiver_main;

12
src/wire-fmt/cap.rs Normal file
View file

@ -0,0 +1,12 @@
pub enum Service {
pub Telephone = 1,
pub Typewriter = 2,
pub IpDce = 3,
pub EthernetDce = 4,
}
pub struct ChannelCapabilities {
pub sample_rate: u64,
}

View file

@ -1,11 +1,5 @@
pub enum SpecialCapability {
pub Telephone = 1,
pub Typewriter = 2,
pub IpDce = 3,
pub EthernetDce = 4,
}
mod cap;
pub use cap::*;
pub struct ChannelCapabilities {
pub channels: usize
pub sample_rate: (u64, Option<u64>),
}
mod msg;
pub use msg::*;

22
src/wire-fmt/wire_msg.rs Normal file
View file

@ -0,0 +1,22 @@
pub struct WireDataBytes {
data: Vec<u8>,
}
pub enum WireDataFrame {
pub Hello {
sender:
},
pub Complaint,
pub Data,
pub ModeChange,
}
impl From<WireDataFrame> for WireDataBytes {
fn from(value: WireDataFrame) -> Self {
let mut buf = Vec::new::<u8>();
buf.append(&mut vec![0xAA, 0xAA]); // Alternating high-low prelude
match value {
// TODO
}
}
}