esp-nimble-cpp
esp-nimble-cpp copied to clipboard
Add L2CAP service infrastructure
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.
Looks great! An example would be welcome if you have time.
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.
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:
- Write the example
- Sync with upstream
- Do some more tests, and
- Resubmit.
Will keep you posted.