This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650: L2CAP example?

Part Number: CC2650
Other Parts Discussed in Thread: BLE-STACK

I'm currently looking at the best way of sending largish amounts of data through BLE (host is Linux with a custom Bluez-based application, peripheral is based on CC2650), and wanted to know if there is an example of using the L2CAP layer directly on the CC2650?

I see that others have been asking similar questions earlier (see for example https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/343848 ) and were told that this would be supported in a future release, and as the BLE-Stack developers guide lists the L2CAP api, I presume that it is supported now? Having an example to see how it's actually used is always nice though.

  • Hi Simon,

    There's ways of influencing the L2CAP Layer, eg, via Data Length Extension. You can increase the payload up to 251 Bytes.

    Couple that with an increased MTU size, you can achieve a larger throughput.

    But, that's only to transfer data quickly, if you just want to send large messages, you can simply do that with a increased MTU size. No need to touch the L2CAP layer at all. Or even design a data service where you do multiple transactions to transmit a large message. Really, it's up to you how you want to implement this on the application size.

    However, no there's no direct control of the L2CAP layer from the application side. (Other than through the existing hci cmds, like DLE as mentioned earlier)

    Regards,
    Rebel
  • Hi Rebel,

    Thanks for the answer. I am also looking for larger throughput though - not only the ability to send large packets. I see that there's the L2CAP_SendSDU() function described in the L2CAP API in the BLE-stack 2.2.1 developer's guide (swru393d.pdf), and was just hoping that there was an example of actually using that somewhere? - and a description of how to receive data also?

    It's mainly as it seems to be really easy to do on the host side (Linux/Bluez), where you can then just open a L2CAP socket and use read/write, without having to implement any GATT functionality.

    Thanks in advance!

  • Hi Simon,

    In that case, I'd recommend looking at the throughput example on the github, it shows how to send a large payload with high throughput. (Using DLE github.com/.../ble_examples )

    And yes, you can use L2CAP_SendSDU, if you have L2CAP Connection Oriented Channels enabled. There's no examples to reference this however, all you have is the documentation there is. ( software-dl.ti.com/.../group___l2_c_a_p.html )

    I can't speak to how it's done on the Linux/BlueZ side; from our perspective, we have a host built in, and the application talks to the host and controller. (If that makes sense) Perhaps that's why interfacing with it is different. (eg, connections done through GAPRole instead of straight HCI commands)

    Regards,
    Rebel