toRequestOptions method

BluetoothLEScanOptions toRequestOptions()

Convert the input requests to a BluetoothLEScanOptions objected needed to start a Bluetooth LE scan.

Implementation

BluetoothLEScanOptions toRequestOptions() {
  if (_acceptAllAdvertisements) {
    return BluetoothLEScanOptions(
        keepRepeatedDevices: _keepRepeatedDevices,
        acceptAllAdvertisements: _acceptAllAdvertisements);
  } else {
    return BluetoothLEScanOptions(
        keepRepeatedDevices: _keepRepeatedDevices,
        filters: _requestFilters.map((final e) => e.toScanFilter()).toList());
  }
}