use le_stream::{FromLeStream, ToLeStream};
use macaddr::MacAddr8;
use crate::ember::types::PanId;
#[derive(Clone, Debug, Eq, PartialEq, FromLeStream, ToLeStream)]
pub struct Network {
channel: u8,
pan_id: PanId,
extended_pan_id: MacAddr8,
allowing_join: bool,
stack_profile: u8,
nwk_update_id: u8,
}
impl Network {
#[must_use]
pub const fn new(
channel: u8,
pan_id: PanId,
extended_pan_id: MacAddr8,
allowing_join: bool,
stack_profile: u8,
nwk_update_id: u8,
) -> Self {
Self {
channel,
pan_id,
extended_pan_id,
allowing_join,
stack_profile,
nwk_update_id,
}
}
#[must_use]
pub const fn channel(&self) -> u8 {
self.channel
}
#[must_use]
pub const fn pan_id(&self) -> PanId {
self.pan_id
}
#[must_use]
pub const fn extended_pan_id(&self) -> MacAddr8 {
self.extended_pan_id
}
#[must_use]
pub const fn allowing_join(&self) -> bool {
self.allowing_join
}
#[must_use]
pub const fn stack_profile(&self) -> u8 {
self.stack_profile
}
#[must_use]
pub const fn nwk_update_id(&self) -> u8 {
self.nwk_update_id
}
}