-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Does scanning continue while advertising #781
Comments
Both can be done at the same time but you will want to adjust your window and interval for both scan and advertise so that there is enough time slicing available for each. You'll need to experiment with the values but I'd start with a 50/50 mix, params :interval 100ms window 50ms for scan and advertising both as a starting point. |
thx for the quick answer :-) What I forgot to mention is that the data is not only sent periodically. If I use your suggestion there is a chance a 50ms advertising does not get detected in a 50/50 scan/advertise ...? |
That's not the advertising duration, just the time inside the interval. The number of intervals is the duration / interval time. So your 10 second duration / 100ms interval time = 100 intervals, so the advertising is happening for 50ms 100 times over 10 seconds. |
I am sorry, I have a lot of trouble getting my head around this :-) This would generate a lot of advertisements with the same data (I only need 1 to go through to the other device) so would it look like this in code?: //Initialisation
And then in the loop() when it needs to advertise:
Or maybe I could make a setup that the receiving device echo's the data and when the sending device receives it and it is the same it stops advertising...? |
Sorry, I was mixing terms with scanning. The min and max advertising interval is was I meant to refer to, which should be different values. The difference between them gives the rest of the ble stack time to work with the radio.
|
Hi,
We have several devices that communicate via ble advertisements and I am struggling a bit with advertisements sometimes not being "seen" by a another device and am trying to understand what the different settings do and how the ble stack exactly works.
I see in the examples:
So it is advertising for 10 seconds. Suppose I have enabled scanning indefinitely before the above code :
NimBLEScan::start(0, ....)
Does the 10 second advertisement interrupt the scanning completely for 10 seconds or is the ble stack that intelligent that it continues scanning in between the advertisements defined by the advertisement interval?
And a second question, what would be the recommended values for these methods knowing a device is both scanning and advertising (power usage is not an issue)
The text was updated successfully, but these errors were encountered: