Skip to main content

scan_until_predicate

Function scan_until_predicate 

Source
pub async fn scan_until_predicate<F>(
    adapter: &Adapter,
    predicate: F,
) -> Result<HashSet<String>>
where F: Fn(&HashSet<String>) -> bool + Send,
Expand description

Start a BLE scan, poll until a predicate is satisfied (or timeout), then stop the scan. Returns the final set of discovered peripheral addresses (lowercase).

ยงErrors

Returns an error if the initial BLE scan fails to start.