esp-nimble-cpp icon indicating copy to clipboard operation
esp-nimble-cpp copied to clipboard

Add L2CAP service infrastructure

Open mickeyl opened this issue 1 year ago • 3 comments

Refers to #83.

This commit adds the ability to service BLE L2CAP connection-oriented-connections (COC).

It follows the GATT service and delegate patterns.

It has been tested successfully on ESP32C3 and ESP32C6 as peripherals and various iOS and MacOS devices as centrals.

NOTE: Please consider this a request-for-comments. It's probably lacking documentation and an example, but as this has been working very well for me, I thought I let it be reviewed by others.

mickeyl avatar Apr 28 '23 14:04 mickeyl

Looks great! An example would be welcome if you have time.

h2zero avatar May 14 '23 19:05 h2zero

For sure. Before this is "pull-ready", I also want to do some changes towards more defensive programming, i.e. removing all the assert and return more error codes.

mickeyl avatar May 15 '23 10:05 mickeyl

It's been a while, but in the meantime, this code has been put through a lot of tests. Apart from one race condition (probably even be in NimBLE) when shutting down a connection while there is still ongoing traffic, everything looks pretty well.

My plan is now:

  1. Write the example
  2. Sync with upstream
  3. Do some more tests, and
  4. Resubmit.

Will keep you posted.

mickeyl avatar Mar 29 '24 14:03 mickeyl