0
votes

I have a BLE peripherial device. I can't connect to it with BluetoothLeGatt example android application and no one other BLE applications in Android Market. But iOS BLE applications can connect to it. This is BluetoothLeGatt connection log:

07-21 21:06:37.506 27402-27420/bluetoothlegatt D/BluetoothLeScanner: onScanResult() - ScanResult{mDevice=xx:xx:xx:xx:xx:xx, mScanRecord=ScanRecord [mAdvertiseFlags=2, mServiceUuids=null, mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=TestBLE], mRssi=-82, mTimestampNanos=12459248011929}
07-21 21:06:37.506 27402-27402/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:06:37.516 27402-27402/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:06:40.930 27402-27402/bluetoothlegatt D/BluetoothAdapter: stopLeScan()
07-21 21:07:50.754 27402-27402/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:07:50.764 27402-27402/bluetoothlegatt D/BluetoothAdapter: stopLeScan()
07-21 21:07:50.764 27402-27402/bluetoothlegatt D/BluetoothAdapter: scan not started yet
07-21 21:07:50.924 27402-27402/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:07:50.924 27402-27402/bluetoothlegatt D/BluetoothGatt: connect() - device: xx:xx:xx:xx:xx:xx, auto: false
07-21 21:07:50.924 27402-27402/bluetoothlegatt D/BluetoothGatt: registerApp()
07-21 21:07:50.924 27402-27402/bluetoothlegatt D/BluetoothGatt: registerApp() - UUID=xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx
07-21 21:07:50.924 27402-27420/bluetoothlegatt D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
07-21 21:07:50.924 27402-27420/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:07:50.934 27402-27402/bluetoothlegatt D/BluetoothLeService: Trying to create a new connection.
07-21 21:07:56.060 27402-27421/bluetoothlegatt D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=xx:xx:xx:xx:xx:xx
07-21 21:07:56.060 27402-27421/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:07:56.060 27402-27421/bluetoothlegatt I/BluetoothLeService: Disconnected from GATT server. 

What should I do for connect to this device? What the difference between Android and iOS BLE connections to BLE peripherial device?

Update: My Android devices:

HTC One M7. Android version: 5.0.2

LG Nexus 5X. Android version: 6.0.1

2

2 Answers

0
votes
07-21 21:07:50.934 27402-27402/bluetoothlegatt D/BluetoothLeService: Trying to create a new connection.
07-21 21:07:56.060 27402-27421/bluetoothlegatt D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=xx:xx:xx:xx:xx:xx
07-21 21:07:56.060 27402-27421/bluetoothlegatt D/BluetoothDevice: mAddress: xx:xx:xx:xx:xx:xx
07-21 21:07:56.060 27402-27421/bluetoothlegatt I/BluetoothLeService: Disconnected from GATT server. 

After sending connect request, till onClientConnectionState, there are about 5 seconds paging time, I assume it may be the paging time out.

There are few inquiries: 1)Is this issue also occurred on other Android phone or only your test phone? 2)What's the advertising interval of you device?

It's strange that you can searched the device but can not connected; or it should be the RF issue between your phone and your device.

0
votes

Looks like I found answer. We use CC2564 Texas Instruments chip. For BLE connection to this chip with BluetoothLeGatt Android example application need to replace this command:

mBluetoothGatt = device.connectGatt(this, false, mGattCallback);

to this command:

mBluetoothGatt = device.connectGatt(this, false, mGattCallback,BluetoothDevice.TRANSPORT_LE);