pub async fn find_device_with_options(
identifier: &str,
options: ScanOptions,
) -> Result<(Adapter, Peripheral)>Expand description
Find a specific device by name or address with custom options.
identifier must match exactly, as find_device describes.
This function uses a retry strategy to improve reliability:
- First checks if the device is already known (cached from previous scans)
- Performs up to 3 scan attempts with increasing durations
This helps with BLE reliability issues where devices may not appear on every scan due to advertisement timing.
Only options.duration is used: the search ignores the filter flags of
options. On macOS every scan attempt asks the Bluetooth stack only for
devices that advertise an Aranet service, as every current Aranet sensor does.
On other platforms every attempt asks for every device.