Repository navigation
Conversation
Android allows a single GATT operation in flight and refuses a write issued while another is pending. The resync burst on connect, pings, controls and Tesla commands could overlap, so writes were silently dropped. Commands now go through a queue that sends one at a time, retries while the stack is busy and gives up on a write whose completion never arrives. writeCommand now returns true once queued. Because a queued write can still be lost (link drop, stack keeps refusing it, the DashKit rejects it or never answers), callers can pass onDropped, which runs on the main thread. The battery preheat, charge port, mirror fold and rear fan toggles use it to show the previous state again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Android allows a single GATT operation in flight and refuses a write issued while another is pending. The resync burst on connect, pings, controls and Tesla commands could overlap, so writes were silently dropped. Commands now go through a queue that sends one at a time, retries while the stack is busy and gives up on a write whose completion never arrives.
writeCommand now returns true once queued. Because a queued write can still be lost (link drop, stack keeps refusing it, the DashKit rejects it or never answers), callers can pass onDropped, which runs on the main thread. The battery preheat, charge port, mirror fold and rear fan toggles use it to show the previous state again.
Testing
Note: #282 also adds a
MAX_WRITE_ATTEMPTSconstant inDashKitBleManager; whichever merges second needs a one-line fix.🤖 Generated with Claude Code