Cannot establish BLE connection between Android 5 and BLE device

牧云@^-^@ 提交于 2019-12-12 21:34:27

问题


I'm stuck with implementing connection between Android Lollipop smartphone and BLE device (TI experimenter board with BLE module). I use following call to connect:

device.connectGatt(context, true, mGattCallback);

I've managed to establish connection for Android 4.3 and 4.4, but when I use this same code for Android 5, I get following error on BluetoothGattCallback::onConnectionStateChange:

onClientConnectionState() - status=133 clientIf=5 device=D0:36:12:CD:73:49

Error code 133 means GATT_ERROR.

I tried to use my own app, google sample and BLE scanner app from play market, but none of them were able to connect to device. I also tried several Android 5 smartphones with no luck.

However, I have another device (TI wireless connectivity development kit), and I can establish connection between it and Android 5 smartphone. So the issue is related to Android 5 and my particular device. I wonder how it can be solved or at least how can I debug this kind of error to find out the root cause.

P.S. I also tried the approach proposed by @nayoso here, but it didn't helped either.


回答1:


You may have hit the maximum connection number, see this: https://www.youtube.com/watch?feature=player_detailpage&v=qx55Sa8UZAQ#t=1712



来源:https://stackoverflow.com/questions/29139948/cannot-establish-ble-connection-between-android-5-and-ble-device

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