zigbee_core/aps/frame/command/
switch_key.rs1use zigbee_macros::impl_byte;
2
3impl_byte! {
4 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
6 pub struct SwitchKey {
7 pub sequence_number: u8,
9 }
10}
11
12#[cfg(test)]
13mod tests {
14 use byte::TryRead;
15 use byte::TryWrite;
16
17 use crate::aps::frame::command::Command;
18
19 #[test]
20 fn round_trip_switch_key() {
21 let frame_buf = [
22 0x09, 0x07, ];
25
26 let (cmd, _) = Command::try_read(&frame_buf, ()).unwrap();
27
28 let mut got_buf = [0u8; _];
29 cmd.try_write(&mut got_buf, ()).unwrap();
30
31 assert_eq!(frame_buf, got_buf);
32 }
33}