How do you update the Android BLE Advertiser service data at runtime?

Viewed 199

I have a BLE Advertiser service running with 3 bits of service data running (ex: 010501) where the 05 could be the version of data that will be set at the characteristic level. I want another device to be able to know to re-read the characteristic without polling it manually. Right now I can restart my advertiser with the new service data when something changes, but there is a ~5-6 second delay for the user. I am wondering if there is a way to update the service data WHILE the advertiser is running. This will lessen the chance of a failure too, as restarting the advertiser can be dicy at times. I need to improve that logic, but for this post, I am wondering if there is a way to avoid the restart completely? Thanks.

1 Answers
Related