Skip to content

Correct duplicate filter inversion #476

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

Conversation

sandeepmistry
Copy link
Contributor

Scanning with duplicates should disable the filter, scanning without duplicates should enable the filter.

Related to #368.

Scanning with duplicates should disable the filter, scanning without
duplicates should enable the filter.
@@ -578,7 +578,7 @@ BLEDevice BLEDeviceManager::peripheral()

bool BLEDeviceManager::startScanning()
{
_adv_duplicate_filter_enabled = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can change code here. If you changed code here, it will make developer confusing. I think change the code in BLEDevice.cpp is more reasonable.

@SidLeung SidLeung self-assigned this Mar 16, 2017
@russmcinnis
Copy link
Contributor

I was actually expecting scan(true) to turn on the duplicate filter so you see devices only once. Is the following the correct behavior?
@sandeepmistry @SidLeung
This is from testing the json that merges PR 476, 478 and 480 which merges a few PRs.
BLE.scan(true); - no filter so same devices are re-scanned
BLE.scan(false); - filter duplicates so you only see devices once
BLE.scan() - filter duplicates so you only see devices once

@russmcinnis
Copy link
Contributor

system test passed

SidLeung added a commit to SidLeung/corelibs-arduino101 that referenced this pull request Mar 22, 2017
Bug fixed:
  This feature was implemented in PR arduino#457, merged, and released
in Deneb.RC1.  However, it was discovered that the logic was
inverted and was report as Git issue arduino#476.  BLE scan() and
input parameter withDuplicates is true means reporting all
Peripherals detected regardless how many times it was reported.

Code mods:
1.  libraries/CurieBLE/src/BLEDevice.cpp:
    - In startScan, calls the correct routine to scan for all
      Peripherals if withDuplicates is true.  Otherwise,
      just scan for new ones.
2.  libraries/CurieBLE/src/BLEDevice.h:
    - Prototyping.
3.  libraries/CurieBLE/src/internal/BLEDeviceManager.h,
    libraries/CurieBLE/src/internal/BLEDeviceManager.cpp
    - Modified header comment to reflect the input parameter
      withDuplictes correct meaning.
    - Default the input parameter, withDupilcates, as true.
    - And, consequently, eliminated some redundant methods.
SidLeung added a commit to SidLeung/corelibs-arduino101 that referenced this pull request Mar 22, 2017
Bug fixed:
  This feature was implemented in PR arduino#457, merged, and released
in Deneb.RC1.  However, it was discovered that the logic was
inverted and was report as Git issue arduino#476.  BLE scan() and
input parameter withDuplicates is true means reporting all
Peripherals detected regardless how many times it was reported.

Code mods:
1.  libraries/CurieBLE/src/BLEDevice.cpp:
    - In startScan, calls the correct routine to scan for all
      Peripherals if withDuplicates is true.  Otherwise,
      just scan for new ones.
2.  libraries/CurieBLE/src/BLEDevice.h:
    - Prototyping.
3.  libraries/CurieBLE/src/internal/BLEDeviceManager.h,
    libraries/CurieBLE/src/internal/BLEDeviceManager.cpp
    - Modified header comment to reflect the input parameter
      withDuplictes correct meaning.
    - Default the input parameter, withDupilcates, as true.
    - And, consequently, eliminated some redundant methods.
SidLeung added a commit to SidLeung/corelibs-arduino101 that referenced this pull request Mar 22, 2017
Bug fixed:
  This feature was implemented in PR arduino#457, merged, and released
in Deneb.RC1.  However, it was discovered that the logic was
inverted and was report as Git issue arduino#476.  BLE scan() and
input parameter withDuplicates is true means reporting all
Peripherals detected regardless how many times it was reported.

Code mods:
1.  libraries/CurieBLE/src/BLEDevice.cpp:
    - In startScan, calls the correct routine to scan for all
      Peripherals if withDuplicates is true.  Otherwise,
      just scan for new ones.
2.  libraries/CurieBLE/src/BLEDevice.h:
    - Prototyping.
3.  libraries/CurieBLE/src/internal/BLEDeviceManager.h,
    libraries/CurieBLE/src/internal/BLEDeviceManager.cpp
    - Modified header comment to reflect the input parameter
      withDuplictes correct meaning.
    - Default the input parameter, withDupilcates, as true.
    - And, consequently, eliminated some redundant methods.
@SidLeung
Copy link
Contributor

This PR is replaced by the following PR,

#491

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

Successfully merging this pull request may close these issues.

4 participants