[][src]Struct rubble::beacon::BeaconScanner

pub struct BeaconScanner<C: ScanCallback, F: AddressFilter> { /* fields omitted */ }

A passive scanner for non-connectable beacon advertisements.

Methods

impl<C: ScanCallback> BeaconScanner<C, AllowAll>[src]

pub fn new(callback: C) -> Self[src]

Creates a BeaconScanner that will report beacons from any device.

impl<C: ScanCallback, F: AddressFilter> BeaconScanner<C, F>[src]

pub fn with_filter(callback: C, scan_filter: F) -> Self[src]

Creates a BeaconScanner with a custom device filter.

pub fn configure(&mut self, now: Instant, interval: Duration) -> Cmd[src]

Configures the BeaconScanner and returns a Cmd to apply to the radio.

The next_update field of the returned Cmd specifies when to call timer_update the next time. The timer used for this does not have to be very accurate, it is only used to switch to the next advertising channel after interval elapses.

pub fn timer_update(&mut self, now: Instant) -> Cmd[src]

Updates the BeaconScanner after the configured timer has fired.

This switches to the next advertising channel and will listen there.

pub fn process_adv_packet(
    &mut self,
    header: Header,
    payload: &[u8],
    crc_ok: bool
) -> Cmd
[src]

Processes a received advertising channel packet.

This should be called whenever the radio receives a packet on the configured advertising channel.

Auto Trait Implementations

impl<C, F> Send for BeaconScanner<C, F> where
    C: Send,
    F: Send

impl<C, F> Sync for BeaconScanner<C, F> where
    C: Sync,
    F: Sync

Blanket Implementations

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> From for T[src]

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]