Skip to content

CurieBLE: BLE.scan(...) allways scans without duplicate filter #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandeepmistry opened this issue Dec 29, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@sandeepmistry
Copy link
Contributor

In https://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieBLE/examples/central/scan/scan.ino:

If I change the BLE.scan(); line to either BLE.scan(true); or BLE.scan(false); all scan without duplicates. I expect it to only receive peripheral per Bluetooth address with the duplicate filter enabled.

@SidLeung
Copy link
Contributor

SidLeung commented Jan 6, 2017

This issue is logged as Jira 802.

@sandeepmistry I think touch on this topic before. The latest Nordic stack does not have readily available support for duplicate filtering. Will investigating this issue further.

@sandeepmistry
Copy link
Contributor Author

Ok, if this is not supported by the Nordic soft device stack, the current API's are very confusing and we need to change them.

@sandeepmistry sandeepmistry changed the title CurieBLE: BLE.scan(...) allows scans without duplicate filter CurieBLE: BLE.scan(...) allways scans without duplicate filter Feb 14, 2017
sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 23, 2017
sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 23, 2017
sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 23, 2017
SidLeung pushed a commit to SidLeung/corelibs-arduino101 that referenced this issue Feb 23, 2017
New feature:
  - Request from Arduino to make our Central BLE library to
    scan Peripheral similar to an Apple device.
  - When filter is set, advertisement from a Peripheral will
    only show up once (until scan is stop and start again) with
    the available() call.  Otherwise, a Peripheral will appear
    as often as the Central can detect its advertisement.
  - Unlike an Apple device, the 101 operates under memory
    constraints.  Thus, the maximum number of filter entries
    is limited to 20.  In other words, if ther are more than
    20 Peripherals, the filter will NOT be able to filter out
    all the advertisement all the time.  A Peripherla WILL
    show up multiple times when available() is called.

Code mods:
1. BLECommon.h:
   - Definition of the filter entries size.
2. BLEDeviceManager.cpp:
   - Peripheral filtering initialization at
     startScanningWithDuplicates().
   - Added deviceInDuplicateFilterBuffer() for search a newly
     detected Peripheral against a recorded list of devices.
   - Added updateDuplicateFilter() to record any newly
     detected Peripoheral.
   - At available(), check for duplicated Peripheral prior
     to return it to caller.  Discard any reported Peripheral.
     Record any newly detected one prior to return it to
     caller.
SidLeung pushed a commit to SidLeung/corelibs-arduino101 that referenced this issue Feb 24, 2017
New feature:
  - Request from Arduino to make our Central BLE library to
    scan Peripheral similar to an Apple device.
  - When filter is set, advertisement from a Peripheral will
    only show up once (until scan is stop and start again) with
    the available() call.  Otherwise, a Peripheral will appear
    as often as the Central can detect its advertisement.
  - Unlike an Apple device, the 101 operates under memory
    constraints.  Thus, the maximum number of filter entries
    is limited to 20.  In other words, if ther are more than
    20 Peripherals, the filter will NOT be able to filter out
    all the advertisement all the time.  A Peripherla WILL
    show up multiple times when available() is called.

Code mods:
1. BLECommon.h:
   - Definition of the filter entries size.
2. BLEDeviceManager.cpp:
   - Peripheral filtering initialization at
     startScanningWithDuplicates().
   - Added deviceInDuplicateFilterBuffer() for search a newly
     detected Peripheral against a recorded list of devices.
   - Added updateDuplicateFilter() to record any newly
     detected Peripoheral.
   - At available(), check for duplicated Peripheral prior
     to return it to caller.  Discard any reported Peripheral.
     Record any newly detected one prior to return it to
     caller.
@kitsunami
Copy link

Addressed by #457

@kitsunami kitsunami assigned sandeepmistry and unassigned noelpaz and SidLeung Feb 24, 2017
@sandeepmistry
Copy link
Contributor Author

I've tested this with the 2.0.1 RC1 release, now a duplicate filter is present. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants