-
Notifications
You must be signed in to change notification settings - Fork 223
Add support for passive scans #283
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
@BartTK : You describe passive scans with your PR (i.e. improvement in crowded BLE environments).
If I want to use the passive scan mode in crowded BLE environments, can you please tell me the best way ?
- Do I call
BLE.scanForUuid(MY_BLE_UUID_SERVICE, true, false);
??
(i.e. withDuplicates = true
and activeScan = false
)
or do I call BLE.scanForUuid(MY_BLE_UUID_SERVICE, false, false);
??
(i.e. withDuplicates = false
and activeScan = false
)
-
Can you please confirm that in any case, if I use your PR-chage with
activeScan = false
, then I have to callBLE.available(true)
in any case ? -
Do you use
BLE.poll();
right in front ofBLE.available(true);
?? (some people seem to recommend this). Is it necessary with your PR-change anymore ? -
I realized that using your
activeScan = false
, then I cannot useperipheral.localName()
anymore to check whether my sender-peripheral has the correct name. Can you confirm that with your PR-change there is no longer the possibility to useperipheral.localName()
? -
Are you aware of the fact that if you use your PR-change that the problematic of freezing receive-centrals still exists ?
See this issue for more information - it is still not solved.
What I mean by freezing receive-central is that with the ArduinoBLE, there is a problem when the receiver-central is on 24/7. And the sender-pheripheral is turned off (cut from battery) and turned on again after hours. This is an issue that is still not solved. Also not with your PR-change.
Thank you for your clarifications on this.
I use BLE.scanForAddress(DEVICE_ADDRESS, true, false);
myself. Followed by a for-loop that keeps calling BLE.available(true);
until it returns a device; that must be the correct device as I was scanning very specifically for the address. There is no BLE.poll();
in there, the BLE.available(true);
takes care of that itself.
When doing a passive scan, you get less information from a device compared to an active scan. I think it is device dependent what it returns exactly. Local names are typically not included, so you shouldn't assume that those are present. It has been a while since I played around with it, but I think the service UUID is included. My guess would be that your BLE.scanForUuid(..);
should work.
I've only added support for passive scans and haven't done anything about that issue you mentioned, so it wasn't my intent to solve that problem here.
@facchinm All checks succeeded, the review was OK and there are no conflicts. Is there anything I still need to do to have this PR merged?
CLAassistant
commented
Dec 4, 2024
CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
BartTK seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
Add support for passive scans. In my case (crowded BLE environment), a passive scan detects devices a lot faster and more reliably. In additional, a passive scan consumes less power as the BLE radio is not transmitting.
Also added the ability to retrieve the devices for which only advertise data is available. That's what you are typically interested in when doing a passive scan.