简体   繁体   中英

Dynamically Changing BLE Advertisement Data Android

Is it possible to change the BLE Advertisement data while BLE advertisement is going on(with out having to stop and start the advertisement).

Use Case : Reading a value of sensor (Say Accelerometer sensor) and advertising it every 1 second.

Yes, you can do it with the setAdvertisingData method from the AdvertisingSet class. However this class was added in API 26 so for previous versions of Android, you will have to restart the advertising.

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