use bitflags::bitflags;
use le_stream::{FromLeStream, ToLeStream};

/// Supported frequency bands.
#[cfg_attr(
    feature = "serde",
    derive(serde::Serialize, serde::Deserialize),
    serde(transparent)
)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, FromLeStream, ToLeStream)]
pub struct FrequencyBand(u8);

bitflags! {
    impl FrequencyBand: u8 {
        /// From 868 MHz to 868.6 MHz.
        const FROM_863_TO_868_MHZ = 0b0001_0000;

        /// From 902 MHz to 928 MHz.
        const FROM_902_TO_928_MHZ = 0b0000_0100;

        /// From 2400 MHz to 2483.5 MHz.
        const FROM_2400_TO_2483_5_MHZ = 0b0000_0010;

        /// GB Smart Energy Sub-GHz Band.
        const GB_SMART_ENEGERGY_SUB_GHZ = 0b0000_0001;
    }
}
