Enum AdvertisingModeHint
#[repr(u8)]pub enum AdvertisingModeHint {
VeryFast = 1,
Fast = 2,
Slow = 3,
}
Expand description
A client can indicate the transmission rate of advertising packets by specifying a mode. The mode provides a hint to the system when configuring the controller with advertising interval and window parameters.
The mode affects how quickly a scanner or central is able to discover the peripheral; however it can have an adverse effect on power consumption. While the system will try to honor a client’s request, it is not guaranteed to do so.
Variants§
VeryFast = 1
Advertise with a very short interval and window for fast discovery at the cost of higher power consumption. This corresponds to a 30-60ms interval on the 1M PHYs and 90-180ms on the coded PHY.
Fast = 2
Advertise with a short interval and window that uses less power than VERY_FAST
.
This corresponds to a 100-150ms interval on the 1M PHYs and 300-450ms on the coded PHY.
Slow = 3
Advertise with a moderate interval and window. This corresponds to 1-1.2s on the 1M PHYs and 3s on the coded PHY.
Implementations§
§impl AdvertisingModeHint
impl AdvertisingModeHint
pub fn from_primitive(prim: u8) -> Option<AdvertisingModeHint>
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
§impl Clone for AdvertisingModeHint
impl Clone for AdvertisingModeHint
§fn clone(&self) -> AdvertisingModeHint
fn clone(&self) -> AdvertisingModeHint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for AdvertisingModeHint
impl Debug for AdvertisingModeHint
§impl<D> Decode<AdvertisingModeHint, D> for AdvertisingModeHintwhere
D: ResourceDialect,
impl<D> Decode<AdvertisingModeHint, D> for AdvertisingModeHintwhere
D: ResourceDialect,
§fn new_empty() -> AdvertisingModeHint
fn new_empty() -> AdvertisingModeHint
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<AdvertisingModeHint, D> for AdvertisingModeHintwhere
D: ResourceDialect,
impl<D> Encode<AdvertisingModeHint, D> for AdvertisingModeHintwhere
D: ResourceDialect,
§impl Hash for AdvertisingModeHint
impl Hash for AdvertisingModeHint
§impl Ord for AdvertisingModeHint
impl Ord for AdvertisingModeHint
§fn cmp(&self, other: &AdvertisingModeHint) -> Ordering
fn cmp(&self, other: &AdvertisingModeHint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for AdvertisingModeHint
impl PartialEq for AdvertisingModeHint
§impl PartialOrd for AdvertisingModeHint
impl PartialOrd for AdvertisingModeHint
§impl TypeMarker for AdvertisingModeHint
impl TypeMarker for AdvertisingModeHint
§type Owned = AdvertisingModeHint
type Owned = AdvertisingModeHint
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for AdvertisingModeHint
impl ValueTypeMarker for AdvertisingModeHint
§type Borrowed<'a> = AdvertisingModeHint
type Borrowed<'a> = AdvertisingModeHint
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<AdvertisingModeHint as TypeMarker>::Owned,
) -> <AdvertisingModeHint as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<AdvertisingModeHint as TypeMarker>::Owned, ) -> <AdvertisingModeHint as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.