Android BT Stack in Kit Kat

2.7k views Asked by At

I was wondering if anyone else was experiencing L2CAP connectivity issues with other devices. I have a device that worked fine under Android 4.1 but now that I'm on Kit Kat it is no longer working. I could listen on a BT socket with a particular service name attribute to make the phone discoverable to the device, but that no longer works.

My thought is that it is the addition of Bluedroid and the removal of the Bluez stack. BLE works well but I've lost the classic BT functionality. I've rebuilt the OS image with BT debugging way up and I can see an odd occurrence where it appears that it tries to connect L2CAP over BLE even though the device is not BLE. Basically there are a lot of ATT and GATT calls that I didn't think should occur for a classic BT device. I've also tried removing the BLE features and rebuilding the stack but that didn't resolve things, which seems to be an indication that L2CAP over BT isn't supported at all (basically it has the same problems of not connecting but without the GATT/ATT calls). Any ideas on whether L2CAP functionality exists in the Bluedroid for classic BT? Is there any way to replace the stack or use a newer version of Bluez (that supports BLE)? Any help or thoughts are greatly appreciated.

Thanks

1

There are 1 answers

0
Sachin Thapa On

Unfortunately L2CAP is not supported version 4.2 onwards, there is an open issue on Android website which have more details.

Issue 58164: Support Bluetooth L2CAP

There seem to be no response on when fix will be done. We were using Wii remote and there is another project android-bluez-ime, which also stopped working.

When I checked BluetoothSocket source code for 4.4, it does have a constant TYPE_L2CAP, see below:

/*package*/ static final int TYPE_RFCOMM = 1;
/*package*/ static final int TYPE_SCO = 2;
/*package*/ static final int TYPE_L2CAP = 3;

However if you look at DOCS it only mentions RFCOMM.

Cheers !!