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.

RTOS/CC2640R2F: L2CAP CoC Connection Oriented Channels support

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hello,

there have been questions regarding L2CAP CoC examples in this forum. Your answer has been that you don't see the need in light of missing smartphone support.

I think it's safe to say that this has changed. iOS supports CoC since iOS 11.0. Android includes the first (very basic) support since 8.0.

and: AFAICT the L2CAP CoC clearly bring some missing features to the table that will make it preferable to using a GATT based communication scheme, namely data-segmentation and flow control which has to be implemented on top of GATT/ATT.

so 2 questions:

1. are L2CAP applications using CoC possible at all for  the cc2640r2? in the _sdk_2_20_00_49 there are a couple of pieces missing (marked as not available for now and clearly not implemented)

/* the following API are not available for now */                                    
#define L2CAP_CmdReject(...)                                     (icall_directAPI(ICA...
#define L2CAP_ConnParamUpdateRsp(...)                            (icall_directAPI(ICA...
#define L2CAP_SetUserConfig(...)                                 (icall_directAPI(ICA...
#define L2CAP_SetBufSize(...)                                    (icall_directAPI(ICA...
#define L2CAP_GetMTU(...)                                        (icall_directAPI(ICA...                                    
#define L2CAP_RegisterApp(...)                                   (AssertHandler(0,0))
#define L2CAP_SendData(...)                                      (AssertHandler(0,0))
#define L2CAP_SetControllerToHostFlowCtrl(...)                   (AssertHandler(0,0))
#define L2CAP_HostNumCompletedPkts(...)                          (AssertHandler(0,0))

2. any advice on how to use the l2cap API to establish a L2CAP CoC and transmit data?

  • Hi Oliver,

    1. L2CAP applications using CoC are supported in the CC2640R2 using the 2.20 SDK.

    2. You can look at the L2CAP CoC section of our BLE 4.2 User's Guide. However, as mentioned in this and other threads, the benefits that CoC provide over GATT are marginal so we still do not have any L2CAP CoC examples. We recommend using data length extension plus larger MTU size instead.

  • thanks for your response Jessica,

    good to hear CoC is supported...wonder why those macros in the icall interface are not enabled (e.g. `L2CAP_RegisterApp` resolves to `(AssertHandler(0,0))`).

    I don't quite see your point about using the data length extension...my reason to implement this is not in the first place to increase bandwidth but offer L2CAP CoC to mobile devices (mainly iOS) that are used to connect.

    why should I put the burden of developing a complete transport-stack to the app developers if L2CAP channels offer all I need? I really fail to get your reasoning behind this.

    As for the missing example: if you support this feature in with your stack you surely have some tests for it. those would already be sufficient.

    can't you make at least a couple of code snippets available for your documentation?

  • Hi Oliver,

    I am not sure what was used to develop/test the L2CAP code. Thank you for your feedback, you made a lot of great points. We have not put much focus on using L2CAP CoC so far because most mobile devices did not support it but this has obviously changed. We will put an L2CAP CoC example on our creative backlog so we can reconsider our stance on the topic.
  • thanks for your response. again, if you have L2CAP CoC working you got to have some test code for it and copy/pasting some lines of code out of it should not be a big deal at all. I would really appreciate any help here.
  • Oliver,

    A script was used with our host_test project to test this code. If this is something you are interested in, I can try to track it down from our test team; however, we do not have a project that uses the L2CAP CoC code.

  • For the information of the community: Oliver and I have taken this discussion offline.

    At this time the L2CAP connection oriented channels (CoC) APIs are not available to be called from an embedded application

    We have brought this to the attention to the R&D team and it is being investigated and tested at an interoperability event.

    This issue may be fixed in the near future, keep an eye on the release notes to see the status of this issue

  • Hi Oliver,

    I have an update about L2CAP CoC. It recently was tested at the latest Bluetooth UnPlug Fest that is put on by the SIG and we actually have found quite good performance of the feature. So to be clear the feature does work on the current SDK (2.30 CC2640R2) and can be used today.

    However, we do agree that we do not have a nice comprehensive example that showcases the feature. 

    This is something we are working on and plan to integrate in the next SDK (2.40).

    For now, I have a basic proof of concept example working using simple_peripheral/simple_central.

    I have attached the changed files in this thread as a tar file. You should be able to place them on top of an existing CC2640R2 SDK.

    /cfs-file/__key/communityserver-discussions-components-files/538/l2cap_5F00_coc.tgz

  • To setup, you connect the central to the peripheral, and select the GATT read option. This will read the PSM from the Simple GATT profile and open an L2CAP CoC with that PSM.
    From there, the peripheral will use the periodicEvent clock (5s) to send a counter to the central. On RX of this data the central sends a counter back.
  • thank you very much for investigating! I was able to successfully test your L2CAP CoC example with SDK 2.30 CC2640R2!