Cannot establish BLE connection between Android 5

2019-07-18 10:22发布

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条回答
\"骚年 ilove
2楼-- · 2019-07-18 10:50

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

查看更多
登录 后发表回答