-
-
Notifications
You must be signed in to change notification settings - Fork 284
Jira 802, BLE Central scan() to filter Peripheral adv, git #369 #457
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
This PR originates from #453. @bigdinotech @eriknyquist , please review the code change. @russmcinnis @noelpaz , please perform system testing. To verify the resolution, you can scan the Russ tower (with 20 Peripherals) with filtering turn on. |
looks good so far with a few devices. Will try for more than 20. Working on sketch to compare and keep count. |
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.
@yashaswini-hanji , please merge this PR to main trunk and close out the ticket 802. Thanks. |
PR merged. Jira 802 is closed. |
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.
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.
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.
New feature:
scan Peripheral similar to an Apple device.
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.
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:
startScanningWithDuplicates().
detected Peripheral against a recorded list of devices.
detected Peripoheral.
to return it to caller. Discard any reported Peripheral.
Record any newly detected one prior to return it to
caller.