use num_traits::FromPrimitive;
use crate::ember::node::Type;
use crate::ember::{Eui64, NodeId};
crate::frame::parameters::handler!(
0x0023,
{ index: u8, joining: bool, child_id: NodeId, child_eui64: Eui64, child_type: u8 },
impl {
impl Handler {
#[must_use]
pub const fn index(&self) -> u8 {
self.index
}
#[must_use]
pub const fn joining(&self) -> bool {
self.joining
}
#[must_use]
pub const fn child_id(&self) -> NodeId {
self.child_id
}
#[must_use]
pub const fn child_eui64(&self) -> Eui64 {
self.child_eui64
}
pub fn child_type(&self) -> Result<Type, u8> {
Type::from_u8(self.child_type).ok_or(self.child_type)
}
}
}
);