use zigbee_macros::impl_byte;
use zigbee_types::ShortAddress;
use zigbee_types::TypeArrayCtx;
use zigbee_types::TypeArrayRef;
impl_byte! {
#[derive(Debug, Clone)]
pub struct LinkPowerDelta<'a> {
pub command_options: CommandOptions,
pub list_count: u8,
#[ctx = TypeArrayCtx::Len(usize::from(list_count))]
#[ctx_write = ()]
pub power_list: TypeArrayRef<'a, DeltaEntry>,
}
}
impl_byte! {
#[tag(u8)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum CommandOptions {
Notification = 0x00,
Request = 0x01,
Response = 0x02,
#[fallback = true]
Reserved(u8),
}
}
impl_byte! {
#[derive(Debug, Clone)]
#[repr(packed, Rust)]
pub struct DeltaEntry {
pub device_address: ShortAddress,
pub delta: u8,
}
}