Fix NimbleBluetooth: process fromPhoneQueue (phone->radio) before toPhoneQueue (radio->phone)#8404
Conversation
…g with 0-length reads during config phase)
…different constant to represent no connection
|
OK, I was able to test this PR successfully with Here is what I had to do to get Without the changes to |
|
#8404 (This PR) works for me without #8405 (This PR + one extra commit) works for me with OR without I think this PR (#8404) is safe and good to merge, and fixes the iOS client issue, and should be compatible with the Android one too. <-- if possible, I wouldn't wait on merging this one, because the current behavior is broken on iOS. 🙏 I'm less sure about #8405 because I don't have a C6L to test with. Maybe @Links2004 can take a peek too? |
|
Update: This PR works as-is both with OR without I made a more minimal guide to using I have tested this PR #8404 with:
|
…omPhone-before-toPhone
|
tested on a Heltec V3 on powersave mode, node reconnects perfectly every time bluetooth wakes up from sleep with no issues. |
…omPhone-before-toPhone
…e-bluetooth-process-fromPhone-before-toPhone Fix NimbleBluetooth: process fromPhoneQueue (phone->radio) before toPhoneQueue (radio->phone)
Fix for the issue in #8385 (comment) where commit 099ab06 breaks the iOS client (especially if trying to connect within the first 10 seconds after boot, it seems).
As @garthvh pointed out, the clients expect to do a write-then-read when sending wantConfig. The read should block until the write is processed. So this switches the processing order and means that
onRead(toPhoneQueue) will block until allonWrite(fromPhoneQueue) packets have been processed!This fixes the iOS client, and simplifies the NimbleBluetooth code significantly! 👏
I've only tested on NimBLE 1. (I'm still fighting to get
NIBMLE_TWOrunning locally...)Would appreciate testing especially from:
🤝 Attestations