Android Bluetooth low energy, how to reuse existin

2019-09-16 12:08发布

问题:

I am able to successfully connect and create bond to my bluetooth low energy target device with android phone. However, if I disable my phone's bluetooth and turn it back on, I would like to reconnect back to my device. I have no problem with reconnecting, it is just that whenever I reconnect, it appears that I still need to perform discover service, and write descriptor to enable notification. Is it possible to skip all these steps on reconnect since I already have a bond? ( I can see that I have a bond because my device shows up in my bluetooth setting)

It looks like I have to reconnect a new bond when I reconnect, is it possible not to?

I tried read and write characteristic after discovering service, it doesn't do anything. I see the bonding already existed in bluetooth settings. I get no callback.

Thanks in advance

回答1:

It turned out it was the target device that I was trying to connect removed the bond, not the android bluetooth sdk's issue. Sorry guys.