Hi Anton, On Wed, Aug 14, 2024 at 5:14 AM Anton Khirnov <anton@xxxxxxxxxxx> wrote: > > Hi, > I'm developing a program that needs to monitor advertisements from > a known LE device (or several) and take action based on their contents. > From looking at the kernel code, there seem to be two relevant ways to > initiate passive scanning: > 1) performing MGMT_OP_ADD_DEVICE with HCI_AUTO_CONN_REPORT; > 2) using an advertisement monitor. > > However, it seems that 1) always enables the duplicates filter, so only > one advertisement for a given device is ever reported; meanwhile 2) can > (after my recent patch) report all the advertisements, but disables > device filtering - so userspace receives reports from all devices, not > just those I care about, which seems inefficient. > > My question then is this - should my use case be implemented by > a) extending HCI_AUTO_CONN_REPORT processing code to allow disabling the > duplicates filter on request; > b) extending the advertisement monitor interface to allow monitoring > only specific devices; > c) something else? Have a look at scan.pattern, it sets a filter which can be either the name or address using active scanning, passive scanning is only meant for auto-connect and depending on things like LL privacy being enable the host may not even see the advertisement reports since it would be done using acceptlist/whitelist filtering which is done directly in the controller. -- Luiz Augusto von Dentz