fix(darwin): write without response canSendWriteWithoutResponse#435
Merged
deadprogram merged 2 commits intoApr 11, 2026
Merged
Conversation
Member
|
@acouvreur can you please rebase this PR against the latest |
8efbf23 to
5c4c47f
Compare
Contributor
Author
Done @deadprogram |
Member
|
Thanks for another fix @acouvreur 😃 now squash/merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
canSendWriteWithoutResponsewill fail ~5 times before actually sendingtrue.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
peripheralisreadybecause it would be error prone to handle with channels and stale events