setadvertising interval vs setinterval vs timeout - still a bit confused #3921
Replies: 1 comment
-
Posted at 2022-01-13 by @fanoush advertising is core feature of BLE, you cannot connect to device if it is not advertising so it basically runs all the time with some interval between packets unless bluetooth is off or device is connected. so '5 sets of advertising once a minute' is not how advertising and BLE works. NRF.setAdvertising is used to change advertising packet data, if you don't call it again, same data packet is advertised repeatedly with preset interval. setInterval is standard javascript method to call something repeatedly, setTimeout is same but runs only once Posted at 2022-01-13 by kab ah ha - makes sense. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-01-13 by kab
I am still a bit confused about the differences between setadvertising interval vs setinterval vs timeout.
Is my understanding of each of these examples correct?
A: This will send out a single, one shot blast of BLE advertisement of the battery, lasting only of 375 ms
B: This will continuously send out a BLE advertisement of the battery once a minute, forever or until the Interval is cleared
C. This, with the press of BTN1, this will send out 5 sets of BLE battery advertising once a minute. Each of those five sets of BLE advertising blasts will last 375 ms. In this case I am not sure if I need XX and YY (see code). This is where I get confused.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions