use zigbee_macros::impl_byte;
use zigbee_types::ByteArray;
use zigbee_types::IeeeAddress;
impl_byte! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct VerifyKey {
pub key_type: u8,
pub source_address: IeeeAddress,
pub hash: ByteArray<16>,
}
}
#[cfg(test)]
mod tests {
use byte::TryRead;
use byte::TryWrite;
use crate::aps::frame::command::Command;
#[test]
fn round_trip_verify_key() {
let frame_buf = [
0x0f, 0x04, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99,
];
let (cmd, _) = Command::try_read(&frame_buf, ()).unwrap();
let mut got_buf = [0u8; _];
cmd.try_write(&mut got_buf, ()).unwrap();
assert_eq!(frame_buf, got_buf);
}
}