Fix Windows filter with services (#111)

* Fix Windows filter with services

* Fix comment typos

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
This commit is contained in:
Rohit Sangwan
2024-12-09 21:02:42 +05:30
committed by GitHub
parent bbf9703303
commit 437eca70af
3 changed files with 5 additions and 4 deletions
@@ -103,7 +103,7 @@ class UniversalBleFilterUtil {
}
fun UniversalScanFilter.hasCustomFilter(): Boolean {
// Only NamePrefix Filtering is not allowed in native filters
// NamePrefix Filtering is not supported in native filters
return withNamePrefix.isNotEmpty()
}
+1 -1
View File
@@ -54,7 +54,7 @@ private class BleCentralDarwin: NSObject, UniversalBlePlatformChannel, CBCentral
}
func startScan(filter: UniversalScanFilter?) throws {
// If filter have any other filter other then official one
// If filter has any other filter other than official one
let hasCustomFilter = filter?.hasCustomFilters ?? false
// Apply services filter
+3 -2
View File
@@ -124,8 +124,9 @@ namespace universal_ble
if (filter != nullptr)
{
// Only Services filter supported natively
bool hasCustomFilters = filter->with_manufacturer_data().size() > 0 || filter->with_name_prefix().size() > 0;
// Native filter supports only 1 service
bool hasCustomFilters = filter->with_services().size() > 1 || filter->with_manufacturer_data().size() > 0 || filter->with_name_prefix().size() > 0;
if (hasCustomFilters)
{
std::cout << "Using Custom Scan Filter" << std::endl;