question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manufacturer Data / Mask seem to be ignored when filtering ScanResults

See original GitHub issue

Hi,

I’m currently trying to set some ScanFilters when registering my BLEScanner to filter on service UUID and Manufacturer Data.

The thing is, while the ScanResults I get are properly filtered with service UUID, there is no filter applied on Manufacturer Data, resulting on inconsistent Scan Result filtering…

I tried the following:

filters.add(ScanFilter.Builder()
                .setServiceUuid(ParcelUuid.fromString(serviceUUID.toString()))
                .build())

filters.add(ScanFilter.Builder()
                .setManufacturerData(manufacturerId, manufacturerData, mask)
                .build())

or

filters.add(ScanFilter.Builder()
                .setManufacturerData(manufacturerId, manufacturerData, mask)
                .setServiceUuid(ParcelUuid.fromString(serviceUUID.toString()))
                .build())

coupled with scanner.startScan(filters, settings, callback)

Scan Results only seem to be filtered on Service UUID.

My manufacturerId is an int, manufacturerData is a ByteArray and mask is a ByteArray of the same size with full 1.

Can you please help me on this issue ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Neargyecommented, Feb 8, 2019

@vicobz maybe you try this way

filters.add(ScanFilter.Builder()
                .setServiceUuid(ParcelUuid.fromString(serviceUUID.toString()))
                .setManufacturerData(manufacturerId, manufacturerData)
                .build())

I use this way in my proj, and all look ok.

1reaction
philips77commented, Jan 11, 2019

hi @vicobz, Sorry for the huuuuge delay. Did you manage to solve your issue? I came back to this library after a while and I can now look into the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android, How to properly scan and filter ble UUID's
The mask i should be opposite - use 1's for bits to include and 0's for those that should be ignored. filter: ...
Read more >
The Ultimate Guide to Android Bluetooth Low Energy
A typical use case for apps is to filter BLE scan results based on the BLE devices' advertised service UUIDs. ScanResult
Read more >
De-identifying sensitive data | Data Loss Prevention ...
The API detects sensitive data such as personally identifiable information (PII), and then uses a de-identification transformation to mask, delete, ...
Read more >
wpa_supplicant.conf - Google Git
For UDP connections (default on Windows): The value will be ignored. This ... #manufacturer=Company ... 0 = do not filter scan results (default)....
Read more >
Qualys API (VM, PC) User Guide
List all scans for AFCO Company client (only for Consultant type ... requested by users, and to upload scan results data to the....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found