Android Bluetooth not discovering the characteristic after changing UUID

梦想与她 提交于 2019-12-23 10:12:35

问题


I am using Android 5.0.1 Lollipop and developing Bluetooth Low Energy server-client communication. I have Samsung Galaxy s4. I have three characteristic in my Custom Service. I made one of the characteristic's property as write-only and encrypted write. Then I changed it to non-encrypted write. The write operation didnt work for this characteristic anymore. I knew I have to restart Bluetooth adapter from settings and unpair the device but it doesn't work anymore at all. Then I changed the UUID of the characteristic. It discovers the characteristic with the old UUID. I dont get it. How can I remove all Bluetooth data related to one particular device from the Bluetooth adapter?

Edit: I doubled checked it with and iPhone device. iPhone discovers the characteristic with the new UUID while Android discovers it the old one.


回答1:


Ok, After more research on settings (Samsung s4 Lollipop 5.01), I found out a way of clearing the Bluetooth cache: Settings -> More -> Application Manager -> All -> Bluetooth -> Clear Cache

If you want to do it programmatically follow this thread: How to programmatically force bluetooth low energy service discovery on Android without using cache



来源:https://stackoverflow.com/questions/32497066/android-bluetooth-not-discovering-the-characteristic-after-changing-uuid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!