zigbee-core 0.1.0

Core Zigbee layers in `no-std` — NWK, APS, security and ZDO; the implementation behind the `zigbee` crate
Documentation
use zigbee_macros::impl_byte;
use zigbee_types::ShortAddress;
use zigbee_types::TypeArrayCtx;
use zigbee_types::TypeArrayRef;

impl_byte! {
    /// Link Power Delta Command Frame
    #[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)]
    /// Link Power Delta Command Options
    #[derive(Debug, Clone, Copy, Eq, PartialEq)]
    pub enum CommandOptions {
        Notification = 0x00,
        Request = 0x01,
        Response = 0x02,
        #[fallback = true]
        Reserved(u8),
    }
}

impl_byte! {
    /// Delta Entry
    #[derive(Debug, Clone)]
    #[repr(packed, Rust)]
    pub struct DeltaEntry {
        pub device_address: ShortAddress,
        pub delta: u8,
    }
}