简体   繁体   中英

Is there a way to fix a BLE advertising interval in Android?

I'm making an Android application and I'd need to send advertising data at a fixed advertising interval.

I've tried setting an advertising interval value using the setInterval() function from AdvertisingSetParameters class, but when I check the advertising interval in a scanner device using nRF Connect or BLE Scanner applications, it shows a lot of variance between advertising intervals.

To sum up, I'd like to know if it's possible to fix an advertising interval in an Android application .

Thank you in advance for your time!

According to documentation , you can set the advertising interval using the setInterval() function of the AdvertisingSetParameters class, as you said. The advertising interval set is fixed.

The phenomena you are experiencing could be due of two possible causes:

  • Your smartphone is broadcasting another set of advertising packet with different advertising interval
  • the scan of BLE advertising messages it fails to capture all packets as often as they were emitted, maybe you are making test in an enviroment crowned of BLE devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM