Start answering hello commands

This commit is contained in:
Joscha 2022-02-12 00:54:27 +01:00
parent fec541b7aa
commit 6cc8670291
5 changed files with 207 additions and 182 deletions

View file

@ -115,3 +115,23 @@ pub enum Packet {
ntf: Ntf,
},
}
impl Packet {
pub fn cmd<C: Into<Cmd>>(id: u64, cmd: C) -> Self {
Self::Cmd {
id,
cmd: cmd.into(),
}
}
pub fn rpl<R: Into<Rpl>>(id: u64, rpl: R) -> Self {
Self::Rpl {
id,
rpl: rpl.into(),
}
}
pub fn ntf<N: Into<Ntf>>(ntf: N) -> Self {
Self::Ntf { ntf: ntf.into() }
}
}