Skip to content

fix(darwin): write without response canSendWriteWithoutResponse#435

Open
acouvreur wants to merge 2 commits intotinygo-org:devfrom
acouvreur:fix-darwin-write-without-response
Open

fix(darwin): write without response canSendWriteWithoutResponse#435
acouvreur wants to merge 2 commits intotinygo-org:devfrom
acouvreur:fix-darwin-write-without-response

Conversation

@acouvreur
Copy link
Copy Markdown
Contributor

@acouvreur acouvreur commented Apr 4, 2026

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

@acouvreur acouvreur marked this pull request as ready for review April 4, 2026 21:47
@acouvreur acouvreur changed the title fix(darwin): write without response use IsReadyToSendWriteWithoutResp… fix(darwin): write without response canSendWriteWithoutResponse Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant