All of lore.kernel.org
 help / color / mirror / Atom feed
* Option to disable filtering of duplicate LE ADV
@ 2016-09-09 20:00 Brennan Ashton
  2016-09-10  8:27 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: Brennan Ashton @ 2016-09-09 20:00 UTC (permalink / raw)
  To: linux-bluetooth

Right now in all of the le_scan functions filter_dup is set to
LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with beacons as
the content may change.  I can force this by sending the HCI commands
to enable scanning without this filter, but then the mgmt api (and
DBUS) cannot be used for scanning.

I was wondering if people had thoughts on making this configurable?

--Brennan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Option to disable filtering of duplicate LE ADV
  2016-09-09 20:00 Option to disable filtering of duplicate LE ADV Brennan Ashton
@ 2016-09-10  8:27 ` Luiz Augusto von Dentz
  2016-09-10 13:15   ` Johan Hedberg
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2016-09-10  8:27 UTC (permalink / raw)
  To: Brennan Ashton; +Cc: linux-bluetooth

Hi Brennan,

On Fri, Sep 9, 2016 at 11:00 PM, Brennan Ashton <brn@deako.com> wrote:
> Right now in all of the le_scan functions filter_dup is set to
> LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with beacons as
> the content may change.  I can force this by sending the HCI commands
> to enable scanning without this filter, but then the mgmt api (and
> DBUS) cannot be used for scanning.
>
> I was wondering if people had thoughts on making this configurable?

Check out the SetDiscoveryFilter:

https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt

When that is used it will not enable duplicated filter and in fact is
the only way to discover beacons which don't have discoverable flags
sets e.g. broadcaster.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Option to disable filtering of duplicate LE ADV
  2016-09-10  8:27 ` Luiz Augusto von Dentz
@ 2016-09-10 13:15   ` Johan Hedberg
  2016-09-12  6:47     ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2016-09-10 13:15 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: Brennan Ashton, linux-bluetooth

Hi Luiz,

On Sat, Sep 10, 2016, Luiz Augusto von Dentz wrote:
> On Fri, Sep 9, 2016 at 11:00 PM, Brennan Ashton <brn@deako.com> wrote:
> > Right now in all of the le_scan functions filter_dup is set to
> > LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with beacons as
> > the content may change.  I can force this by sending the HCI commands
> > to enable scanning without this filter, but then the mgmt api (and
> > DBUS) cannot be used for scanning.
> >
> > I was wondering if people had thoughts on making this configurable?
> 
> Check out the SetDiscoveryFilter:
> 
> https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt
> 
> When that is used it will not enable duplicated filter and in fact is
> the only way to discover beacons which don't have discoverable flags
> sets e.g. broadcaster.

Actually Brennan is right that none of these methods disable duplicate
filtering. All of the places in the kernel that set the LE scan
parameters explicitly enable duplicate filtering. I suppose we should
seriously consider extending the mgmt API to allow performing LE scan
without the duplicate filtering. Right now the only way to do that is
through raw HCI access.

Johan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Option to disable filtering of duplicate LE ADV
  2016-09-10 13:15   ` Johan Hedberg
@ 2016-09-12  6:47     ` Marcel Holtmann
  2016-09-12 10:52       ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2016-09-12  6:47 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: Luiz Augusto von Dentz, Brennan Ashton, linux-bluetooth

Hi Johan,

>>> Right now in all of the le_scan functions filter_dup is set to
>>> LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with beacons as
>>> the content may change.  I can force this by sending the HCI commands
>>> to enable scanning without this filter, but then the mgmt api (and
>>> DBUS) cannot be used for scanning.
>>> 
>>> I was wondering if people had thoughts on making this configurable?
>> 
>> Check out the SetDiscoveryFilter:
>> 
>> https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt
>> 
>> When that is used it will not enable duplicated filter and in fact is
>> the only way to discover beacons which don't have discoverable flags
>> sets e.g. broadcaster.
> 
> Actually Brennan is right that none of these methods disable duplicate
> filtering. All of the places in the kernel that set the LE scan
> parameters explicitly enable duplicate filtering. I suppose we should
> seriously consider extending the mgmt API to allow performing LE scan
> without the duplicate filtering. Right now the only way to do that is
> through raw HCI access.

however when a driver sets the strict duplicate filtering quirk, then scanning will be restarted and thus new advertising data can be found.

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Option to disable filtering of duplicate LE ADV
  2016-09-12  6:47     ` Marcel Holtmann
@ 2016-09-12 10:52       ` Luiz Augusto von Dentz
  2016-09-12 16:42         ` Brennan Ashton
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2016-09-12 10:52 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Johan Hedberg, Brennan Ashton, linux-bluetooth

Hi Marcel, Johan,

On Mon, Sep 12, 2016 at 9:47 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Johan,
>
>>>> Right now in all of the le_scan functions filter_dup is set to
>>>> LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with beacons as
>>>> the content may change.  I can force this by sending the HCI commands
>>>> to enable scanning without this filter, but then the mgmt api (and
>>>> DBUS) cannot be used for scanning.
>>>>
>>>> I was wondering if people had thoughts on making this configurable?
>>>
>>> Check out the SetDiscoveryFilter:
>>>
>>> https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt
>>>
>>> When that is used it will not enable duplicated filter and in fact is
>>> the only way to discover beacons which don't have discoverable flags
>>> sets e.g. broadcaster.
>>
>> Actually Brennan is right that none of these methods disable duplicate
>> filtering. All of the places in the kernel that set the LE scan
>> parameters explicitly enable duplicate filtering. I suppose we should
>> seriously consider extending the mgmt API to allow performing LE scan
>> without the duplicate filtering. Right now the only way to do that is
>> through raw HCI access.
>
> however when a driver sets the strict duplicate filtering quirk, then scanning will be restarted and thus new advertising data can be found.

Im not sure what the quirk actually means but it doesn't look like it
will be able to attend the RSSI filtering since the controller may
omit results thus why I though duplicate was not enabled when
filtering is. From the code it looks like the quirk would force
restarting the scanning:

/* If duplicate filtering does not report RSSI changes, then restart
* scanning to ensure updated result with updated RSSI values.
*/
if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)) {
restart_le_scan(hdev);

Isn't that a causing a little too many restarts? I wonder if there is
anyone using this quirk in practice? And is this really worth it
instead of just disabling the duplicate filter?

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Option to disable filtering of duplicate LE ADV
  2016-09-12 10:52       ` Luiz Augusto von Dentz
@ 2016-09-12 16:42         ` Brennan Ashton
  0 siblings, 0 replies; 6+ messages in thread
From: Brennan Ashton @ 2016-09-12 16:42 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, Marcel Holtmann; +Cc: Johan Hedberg, linux-bluetooth

On Mon, 2016-09-12 at 13:52 +0300, Luiz Augusto von Dentz wrote:
> Hi Marcel, Johan,
> 
> On Mon, Sep 12, 2016 at 9:47 AM, Marcel Holtmann <marcel@holtmann.org
> > wrote:
> > 
> > Hi Johan,
> > 
> > > 
> > > > 
> > > > > 
> > > > > Right now in all of the le_scan functions filter_dup is set
> > > > > to
> > > > > LE_SCAN_FILTER_DUP_ENABLE.  This is not always desired with
> > > > > beacons as
> > > > > the content may change.  I can force this by sending the HCI
> > > > > commands
> > > > > to enable scanning without this filter, but then the mgmt api
> > > > > (and
> > > > > DBUS) cannot be used for scanning.
> > > > > 
> > > > > I was wondering if people had thoughts on making this
> > > > > configurable?
> > > > 
> > > > Check out the SetDiscoveryFilter:
> > > > 
> > > > https://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapte
> > > > r-api.txt
> > > > 
> > > > When that is used it will not enable duplicated filter and in
> > > > fact is
> > > > the only way to discover beacons which don't have discoverable
> > > > flags
> > > > sets e.g. broadcaster.
> > > 
> > > Actually Brennan is right that none of these methods disable
> > > duplicate
> > > filtering. All of the places in the kernel that set the LE scan
> > > parameters explicitly enable duplicate filtering. I suppose we
> > > should
> > > seriously consider extending the mgmt API to allow performing LE
> > > scan
> > > without the duplicate filtering. Right now the only way to do
> > > that is
> > > through raw HCI access.
> > 
> > however when a driver sets the strict duplicate filtering quirk,
> > then scanning will be restarted and thus new advertising data can
> > be found.
> 
> Im not sure what the quirk actually means but it doesn't look like it
> will be able to attend the RSSI filtering since the controller may
> omit results thus why I though duplicate was not enabled when
> filtering is. From the code it looks like the quirk would force
> restarting the scanning:
> 
> /* If duplicate filtering does not report RSSI changes, then restart
> * scanning to ensure updated result with updated RSSI values.
> */
> if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)) {
> restart_le_scan(hdev);
> 
> Isn't that a causing a little too many restarts? I wonder if there is
> anyone using this quirk in practice? And is this really worth it
> instead of just disabling the duplicate filter?
> 

I am not sure I fully understand what this quirk, but I suspect we are
going to want to have the option for turning on duplicate filtering.
Beacons and mesh are going to become more and more common and the later
would cause an HCI event every time a new packet was broadcast. In most
cases these are not of interest to people unless they are explicity
expecting them.

I would propose adding SetSuplicateFilter to the adaptor API. I am
happy to write some code for this today if people think this makes
sense.


--Brennan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-12 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 20:00 Option to disable filtering of duplicate LE ADV Brennan Ashton
2016-09-10  8:27 ` Luiz Augusto von Dentz
2016-09-10 13:15   ` Johan Hedberg
2016-09-12  6:47     ` Marcel Holtmann
2016-09-12 10:52       ` Luiz Augusto von Dentz
2016-09-12 16:42         ` Brennan Ashton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.