micropython / micropython/micropython-lib

Add filter options to scanning

Open
#794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

This is a feature request for the aioble/low-level bluetooth libraries

The use case is a remote patient monitoring central application that needs to support a large set of personal health devices, a few of which support the BT SIG health device profiles but the vast majority of which are proprietary. The idea is to present to the user only newly discovered devices that the central understands and connect automatically to those the user has already opted to connected to. The users are not tech-savvy and know nothing about Bluetooth.

It would be advantageous (at least for these needs) if the scan results could be filtered. For example, I want to only receive connectable advertisements/scan responses that have one of a list of service UUIDs or whose name contains a certain string or whose manufacturer data contains certain sets of masked byes. IN my case I am looking for these values in the adv and or scan response.

Of course it is possible to do this filtering on the scanResults received at the application level but in a location where there are floods of advertisements coming from all kinds of junk (such as in an apartment building) the library would be able to block the unwanted material at a lower level, and depending upon the platform and BTLE chip, maybe even in hardware. This would increase efficiency.

It would also be convenient to knock off duplicates by address. Of course, that would only work if the scanner is run periodically (say for 12 seconds) and then restarted resetting the duplicate filter, otherwise a device would be permanently blocked once seen.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the aioble and low-level Bluetooth scanning entry points and reviewing how scan results expose advertisements and scan responses; define the supported filtering inputs and duplicate-by-address behavior before implementation. Done should be demonstrated by coverage for the requested filters and periodic-scan duplicate reset semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.