fix(darwin): write without response canSendWriteWithoutResponse by acouvreur · Pull Request #435 · tinygo-org/bluetooth

After #386, WriteWithoutResponses does not work anymore. For some reason, the buffer is considered full.

This is actually a known issue: hbldh/bleak#1589

And we can take a look at how Nordic have implemented this to work on Mac:

https://github.com/nordicsemi/IOS-nRF-Connect-Device-Manager/blob/30925fa37b453fafd34eb470d24851c6667d4848/Source/Bluetooth/McuMgrBleTransport.swift#L413-L435

Basically, it is expected that the canSendWriteWithoutResponse will fail ~5 times before actually sending true.


I'm trying this with the https://developer.apple.com/documentation/corebluetooth/cbperipheraldelegate/peripheralisready(tosendwritewithoutresponse:) which avoid looping.

I will test this and will let you know if this works.

Update: I've successfully tested it and it work.

Update 2: I've removed depending on peripheralisready because it would be error prone to handle with channels and stale events