play over network

This commit is contained in:
Andy Killorin 2024-12-09 16:43:35 -05:00
commit 860e49de9d
Signed by: ank
GPG key ID: B6241CA3B552BCA4
3 changed files with 123 additions and 8 deletions

2
outside/Cargo.lock generated
View file

@ -264,6 +264,7 @@ dependencies = [
name = "common"
version = "0.1.0"
dependencies = [
"heapless 0.8.0",
"serde",
"sha3",
]
@ -1303,6 +1304,7 @@ checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
dependencies = [
"defmt",
"hash32 0.3.1",
"serde",
"stable_deref_trait",
]

View file

@ -83,7 +83,7 @@ pub enum MusicCommand {
Introduce(Name, bool),
/// 0-30
SetVolume(u8),
Play(&'static str),
Play(heapless::String<32>),
Button(),
}

View file

@ -72,6 +72,9 @@ pub async fn server_task(stack: embassy_net::Stack<'static>) {
Ok(Request::SetVolume(vol)) => {
COMMANDS.send(crate::music::MusicCommand::SetVolume(vol)).await;
}
Ok(Request::Play(song)) => {
COMMANDS.send(crate::music::MusicCommand::Play(song))
}
Err(e) => { info!("parse error: {e}") }
}
}