Skip to content

fix(darwin): write without response canSendWriteWithoutResponse#435

Merged
deadprogram merged 2 commits into
tinygo-org:devfrom
acouvreur:fix-darwin-write-without-response
Apr 11, 2026
Merged

fix(darwin): write without response canSendWriteWithoutResponse#435
deadprogram merged 2 commits into
tinygo-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
@deadprogram
Copy link
Copy Markdown
Member

@acouvreur can you please rebase this PR against the latest dev? Thanks.

@acouvreur acouvreur force-pushed the fix-darwin-write-without-response branch from 8efbf23 to 5c4c47f Compare April 9, 2026 16:50
@acouvreur
Copy link
Copy Markdown
Contributor Author

@acouvreur can you please rebase this PR against the latest dev? Thanks.

Done @deadprogram

@deadprogram
Copy link
Copy Markdown
Member

Thanks for another fix @acouvreur 😃 now squash/merging.

@deadprogram deadprogram merged commit 75ce228 into tinygo-org:dev Apr 11, 2026
4 checks passed
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.

2 participants