use anyhow::Result;
use ddp_rs::connection;
use ddp_rs::protocol;
fn main() -> Result<()> {
let mut conn = connection::DDPConnection::try_new(
"192.168.1.40:4048", protocol::PixelConfig::default(), protocol::ID::Default,
std::net::UdpSocket::bind("0.0.0.0:4048").unwrap(), )?;
for i in 0u8..100u8 {
let high = 10u8.overflowing_mul(i).0;
let temp: usize = conn.write(&vec![
high,
0,
0,
high,
0,
0,
0,
high,
0,
0,
high,
0,
0,
0,
high,
0,
0,
high,
])?;
std::thread::sleep(std::time::Duration::from_millis(10));
println!("sent {temp} packets");
}
Ok(())
}