Initial commit
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
use std::net::IpAddr;
|
||||
use std::str::FromStr;
|
||||
|
||||
use dsp_thomann::DSP408;
|
||||
use dsp_thomann::types;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
let host = IpAddr::from_str("192.168.49.30")?;
|
||||
|
||||
let mut dsp = DSP408::new(
|
||||
host,
|
||||
9761,
|
||||
1,
|
||||
)?;
|
||||
|
||||
println!("Connecting to DSP...");
|
||||
match dsp.connect() {
|
||||
Ok(_) => {
|
||||
println!("Connected successfully");
|
||||
}
|
||||
|
||||
Err(e) => {
|
||||
eprintln!("Connection failed: {}", e);
|
||||
return Err(Box::new(e));
|
||||
}
|
||||
}
|
||||
println!("DSP connected.");
|
||||
|
||||
dsp.set_mute(types::Channel::Input(types::InputChannel::InA), true)?;
|
||||
|
||||
dbg!(dsp.state()?);
|
||||
|
||||
println!("Disconnecting...");
|
||||
dsp.disconnect();
|
||||
println!("Disconnected");
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user