pub struct Scanner<'d, 'stack, C: Controller, P: PacketPool> { /* private fields */ }Expand description
A scanner that wraps a central to provide additional functionality around BLE scanning.
The buffer size can be tuned if in a noisy environment that returns a lot of results.
Implementations§
Source§impl<'d, 'stack, C: Controller, P: PacketPool> Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C: Controller, P: PacketPool> Scanner<'d, 'stack, C, P>
Sourcepub fn new(central: &'d mut Central<'stack, C, P>) -> Self
pub fn new(central: &'d mut Central<'stack, C, P>) -> Self
Create a new scanner with the provided central.
Sourcepub async fn scan_ext(
&mut self,
config: &ScanConfig<'_>,
) -> Result<ScanSession<'stack, true>, BleHostError<C::Error>>
pub async fn scan_ext( &mut self, config: &ScanConfig<'_>, ) -> Result<ScanSession<'stack, true>, BleHostError<C::Error>>
Performs an extended BLE scan, return a report for discovering peripherals.
Scan is stopped when a report is received. Call this method repeatedly to continue scanning.
Sourcepub async fn scan(
&mut self,
config: &ScanConfig<'_>,
) -> Result<ScanSession<'stack, false>, BleHostError<C::Error>>
pub async fn scan( &mut self, config: &ScanConfig<'_>, ) -> Result<ScanSession<'stack, false>, BleHostError<C::Error>>
Performs a BLE scan, return a report for discovering peripherals.
Scan is stopped when a report is received. Call this method repeatedly to continue scanning.
Auto Trait Implementations§
impl<'d, 'stack, C, P> Freeze for Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C, P> !RefUnwindSafe for Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C, P> !Send for Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C, P> !Sync for Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C, P> Unpin for Scanner<'d, 'stack, C, P>
impl<'d, 'stack, C, P> !UnwindSafe for Scanner<'d, 'stack, C, P>
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