[][src]Struct rubble::phy::AdvertisingChannel

pub struct AdvertisingChannel(_);

One of the three advertising channels (channel indices 37, 38 or 39).

Methods

impl AdvertisingChannel[src]

pub fn first() -> Self[src]

Returns the first (lowest-numbered) advertising channel.

pub fn iter_all() -> impl Iterator<Item = Self>[src]

Returns an iterator that yields all 3 advertising channels in ascending order.

pub fn cycle(&self) -> Self[src]

Returns the next advertising channel, or the first one if self is the last channel.

pub fn rf_channel(&self) -> u8[src]

Returns the RF channel corresponding to this advertising channel index.

RF channels 0, 12 and 39 are used for advertising.

pub fn freq(&self) -> u16[src]

Returns the center frequency of this channel in MHz.

pub fn whitening_iv(&self) -> u8[src]

Calculates the initial value of the LFSR to use for data whitening.

The value is a 7-bit value. The MSb will always be 0, and the 2nd MSb always 1 (Position 0). The LSb contains Position 6. Refer to the specification for details about the bit positions.

The polynomial is always x^7 + x^4 + 1.

Whitening is applied to PDU and CRC.

Trait Implementations

impl Debug for AdvertisingChannel[src]

impl Copy for AdvertisingChannel[src]

impl Clone for AdvertisingChannel[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]