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 theTriggertrait.
Implementations§
source§impl<'a, T: Trigger> Scanner<'a, T>
impl<'a, T: Trigger> Scanner<'a, T>
sourcepub fn new(
notifier: Notifier<T>,
timer: Timer<'a, T>,
state: Arc<Mutex<State>>,
payload: Arc<Mutex<Option<Vec<u8>>>>,
config: ScannerConfig<T>,
) -> Result<Self>
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.