Struct esp32_simple::ble::Scanner

source ·
pub struct Scanner<'a, T: Trigger> { /* private fields */ }
Expand description

Represents a BLE scanner.

§Type Parameters

  • 'a - Lifetime of the scanner.
  • T - The trigger type implementing the Trigger trait.

Implementations§

source§

impl<'a, T: Trigger> Scanner<'a, T>

source

pub fn new( notifier: Notifier<T>, timer: Timer<'a, T>, state: Arc<Mutex<State>>, payload: Arc<Mutex<Option<Vec<u8>>>>, config: ScannerConfig<T>, ) -> Result<Self>

Creates a new Scanner instance.

§Arguments
  • notifier - A notifier to send scan results.
  • timer - A timer for scan intervals.
  • state - Shared state of the scanner.
  • payload - Shared storage for BLE payload data.
  • config - Scan configuration (triggers, frequency, etc.).
§Returns

A new Scanner ready to poll.

§Errors

Returns an error if the scanner cannot be initialized.

Trait Implementations§

source§

impl<T: Trigger> Poller for Scanner<'_, T>

source§

fn poll(&mut self) -> Result<!>

Polls the BLE scanner for devices.

This function continuously scans for BLE devices and notifies the results.

§Errors

Returns an error if the scan or notification fails.

Auto Trait Implementations§

§

impl<'a, T> !Freeze for Scanner<'a, T>

§

impl<'a, T> !RefUnwindSafe for Scanner<'a, T>

§

impl<'a, T> Send for Scanner<'a, T>

§

impl<'a, T> Sync for Scanner<'a, T>

§

impl<'a, T> Unpin for Scanner<'a, T>
where T: Unpin,

§

impl<'a, T> !UnwindSafe for Scanner<'a, T>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.