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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user