feat(android): Tesla BLE core - client, status source, VIN-matched scanner (2/3) - #207
Closed
dkneeland wants to merge 1 commit into
Closed
feat(android): Tesla BLE core - client, status source, VIN-matched scanner (2/3)#207dkneeland wants to merge 1 commit into
dkneeland wants to merge 1 commit into
Conversation
dkneeland
force-pushed
the
feat/tesla-ble-core
branch
from
August 25, 2026 23:32
227922a to
3f36db2
Compare
…anner Introduce the Tesla app-channel BLE layer: - TeslaClient commands incl. CMD_PROVISION with full 17-char VIN and MAC validation, reversed NimBLE byte order, and no full-VIN logging - a GATT write is treated as dispatch only; Staged status is the provisioning acknowledgement - TeslaStatus / TeslaStatusSource parsing with reset-request plumbing - TeslaVehicleScanner matches only advertisements derived from the supplied VIN (legacy SHA-1 prefix with all role suffixes, modern 4/5/6-char tails) Unit coverage for payload bytes, invalid inputs, name matching.
dkneeland
force-pushed
the
feat/tesla-ble-core
branch
from
August 25, 2026 23:46
3f36db2 to
09f07fc
Compare
Collaborator
Author
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.
Part 2 of 3 of a stacked series that supersedes #201 (closed; work redistributed across this stack). Stacks on Part 1 (
feat/vin-pipeline).What & why
The Tesla app-channel BLE layer, hardened per the post-review audit of #201:
TeslaClient— commands incl.CMD_PROVISION. Payload built only after validating all 17 VIN chars and the complete MAC (length + hex + separators); preserves the required reversed NimBLE MAC byte order; the full VIN is never logged (generic rejection message instead).TeslaLinkState.Stagedis the provisioning acknowledgement.TeslaStatus/TeslaStatusSource— notification parsing plusrequestReset()plumbing withresetPendingcleared onNeverEnrolled/Staged.TeslaVehicleScanner— matches only advertisements derived from the supplied VIN: legacyS+ first 8 bytes ofSHA1(VIN)hex + every supported role suffix, and modernTesla+ 4-, 5-, and 6-char VIN tails. No generic "any Tesla name" discovery path.No UI yet — Home/Settings are untouched until Part 3 wires the enrollment flow.
Tests
Provision payload byte-layout (opcode, ASCII VIN, address type, reversed MAC), invalid VIN/MAC rejection, legacy/modern name matching incl. all suffix/tail lengths,
TeslaStatusparsing. FulltestDebugUnitTestgreen at carve time.Stack & merge order
Merge after Part 1. On merge of Part 1, this PR's base retargets to
main(auto if Part 1's branch is deleted) — click Update branch so the diff collapses to just this PR's changes, then squash-merge. Part 3 stacks on this branch.