zigbee_core/aps/frame/command/
confirm_key.rs1use zigbee_macros::impl_byte;
2use zigbee_types::IeeeAddress;
3
4impl_byte! {
5 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
7 pub struct ConfirmKey {
8 pub status: u8,
10 pub key_type: u8,
12 pub destination_address: IeeeAddress,
14 }
15}
16
17#[cfg(test)]
18mod tests {
19 use byte::TryRead;
20 use byte::TryWrite;
21
22 use crate::aps::frame::command::Command;
23
24 #[test]
25 fn round_trip_confirm_key() {
26 let frame_buf = [
27 0x10, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
32 ];
33
34 let (cmd, _) = Command::try_read(&frame_buf, ()).unwrap();
35
36 let mut got_buf = [0u8; _];
37 cmd.try_write(&mut got_buf, ()).unwrap();
38
39 assert_eq!(frame_buf, got_buf);
40 }
41}