Unknown errors trying to open L2CAP sockets.

Hi!


I've been trying out L2CAP via BLE to evaluate its feasibility for a project I'm working on.


To learn the API i just downloaded an example app from here: https://github.com/paulw11/L2CapDemo


The problem is, I keep getting a [CoreBluetooth] WARNING: Unknown error: 431 and a SIGPIPE when I try to write to the open output stream.


The delegate callback


func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?)


does not give me an error , and everything seems normal. The output stream even says it hasSpaceAvailable and is ready for writing to.


I have gotten the app to work once, but after that one time, it fails every time. Even without making any changes to the code.


Any help is appreciated.


Cheers