pub struct Channel {
pub primary: u8,
pub cbw: Cbw,
}
Expand description
A Channel defines the frequency spectrum to be used for radio synchronization. See for sister definitions in FIDL and C/C++
- //sdk/fidl/fuchsia.wlan.common/wlan_common.fidl |struct wlan_channel_t|
- //sdk/fidl/fuchsia.wlan.mlme/wlan_mlme.fidl |struct WlanChan|
Fields§
§primary: u8
§cbw: Cbw
Implementations§
Source§impl Channel
impl Channel
pub fn new(primary: u8, cbw: Cbw) -> Self
Sourcepub fn get_center_freq(&self) -> Result<MHz, Error>
pub fn get_center_freq(&self) -> Result<MHz, Error>
Returns the center frequency of the first consecutive frequency segment of the channel in MHz if the channel is valid, Err(String) otherwise.
Sourcepub fn is_valid_in_us(&self) -> bool
pub fn is_valid_in_us(&self) -> bool
Returns true if the primary channel index, channel bandwidth, and the secondary consecutive frequency segment (Cbw80P80 only) are all consistent and meet regulatory requirements of the USA. TODO(https://fxbug.dev/42104247): Other countries.
Sourcepub fn is_2ghz(&self) -> bool
pub fn is_2ghz(&self) -> bool
Returns true if the channel is 2GHz. Does not perform validity checks.
Sourcepub fn is_5ghz(&self) -> bool
pub fn is_5ghz(&self) -> bool
Returns true if the channel is 5GHz. Does not perform validity checks.
pub fn is_dfs(&self) -> bool
Trait Implementations§
Source§impl From<&Channel> for WlanChannel
impl From<&Channel> for WlanChannel
Source§fn from(channel: &Channel) -> WlanChannel
fn from(channel: &Channel) -> WlanChannel
Converts to this type from the input type.
Source§impl From<&Channel> for WlanChannel
impl From<&Channel> for WlanChannel
Source§fn from(channel: &Channel) -> WlanChannel
fn from(channel: &Channel) -> WlanChannel
Converts to this type from the input type.
Source§impl From<Channel> for WlanChannel
impl From<Channel> for WlanChannel
Source§fn from(channel: Channel) -> WlanChannel
fn from(channel: Channel) -> WlanChannel
Converts to this type from the input type.
Source§impl From<Channel> for WlanChannel
impl From<Channel> for WlanChannel
Source§fn from(channel: Channel) -> WlanChannel
fn from(channel: Channel) -> WlanChannel
Converts to this type from the input type.
Source§impl Ord for Channel
impl Ord for Channel
Source§impl PartialOrd for Channel
impl PartialOrd for Channel
Source§impl TryFrom<&WlanChannel> for Channel
impl TryFrom<&WlanChannel> for Channel
Source§impl TryFrom<WlanChannel> for Channel
impl TryFrom<WlanChannel> for Channel
impl Copy for Channel
impl Eq for Channel
impl StructuralPartialEq for Channel
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)