Bluetooth L2CAP iOS

Hi,

I have 2 questions:

  1. the api for L2CAP is only for BLE or can also work for BR/EDR? (currently didn't manage to connect with BR/EDR)

  2. I use https://github.com/bluekitchen/CBL2CAPChannel-Demo on iPhone with le_credit_based_flow_control_mode from blue kitchen and the throughput was very low. I also tried to use L2TEST from Bluez (which uses L2CAP BASIC MODE) but it failed to connect

Can anybody help how to increase throughput? The best result I received was 18 kilobyte/second.

Thank you

Replies

The CoreBluetooth L2CAP API refers to BLE, not classic BT. With Apple device as central, you will not get good performance, since the channel parameters (L2CAP COC SDU + MPS) and connection parameters can't be set. There's just no API for that (opened FB13742028 for that). I was able to get 36KB/sec for that scenario.

With Apple device as peripheral, you should be able to get up to 100 KB/sec. I have been able to achieve that using an ESP32S3. Note that you make sure to use BLE4.2 DLE (which might not be enabled as default on your system) and a sufficiently high SDU. Apple devices seem to support up to 2048 as SDU.

FWIW, I recently managed to get a 15ms connection interval negotiated (initiated by the peripheral), so 60KB/sec is now possible with an Apple device as the central.