Always use custom scan filter for Windows

This commit is contained in:
Foti Dim
2026-02-10 11:42:17 +01:00
parent a7f04101a0
commit 167d84f838
2 changed files with 3 additions and 20 deletions
+1
View File
@@ -3,6 +3,7 @@
* Add `serviceData` in `BleDevice`
* Add `AndroidScanMode` and `reportDelayMillis` to `AndroidOptions` for scanning
* Add support for BLE scanning from background services (ForegroundTask) on Android. `PermissionHandler` is now activity-aware and succeeds silently if permissions are already granted when no activity is available
* Always use custom scan filter on Windows
## 1.1.0
* Add readRssi method
-18
View File
@@ -165,26 +165,8 @@ UniversalBlePlugin::StartScan(const UniversalScanFilter *filter, const Universal
resetScanFilter();
if (filter != nullptr) {
// Native filter supports only 1 service
const bool uses_custom_filters =
filter->with_services().size() > 1 ||
filter->with_manufacturer_data().size() > 0 ||
filter->with_name_prefix().size() > 0;
if (uses_custom_filters) {
UniversalBleLogger::LogInfo("Using Custom Scan Filter");
setScanFilter(*filter);
} else {
// Apply Services filter
if (!filter->with_services().empty()) {
for (const auto &uuid : filter->with_services()) {
bluetooth_le_watcher_.AdvertisementFilter()
.Advertisement()
.ServiceUuids()
.Append(uuid_to_guid(std::get<std::string>(uuid)));
}
}
}
}
bluetooth_le_watcher_received_token_ = bluetooth_le_watcher_.Received(