Skip to content

fix(obd): _hexTokens compact-hex parse — PR #88 gerçek araç blocker'ı#89

Open
selimmujdeci wants to merge 1 commit into
feat/w5-obd-pr1-native-handshakefrom
fix/obd-handshake-hextokens-compact
Open

fix(obd): _hexTokens compact-hex parse — PR #88 gerçek araç blocker'ı#89
selimmujdeci wants to merge 1 commit into
feat/w5-obd-pr1-native-handshakefrom
fix/obd-handshake-hextokens-compact

Conversation

@selimmujdeci

Copy link
Copy Markdown
Owner

Sorun (gerçek araç doğrulamasında bulundu)

PR #88 native handshake gerçek araçta doğru çalışıyor (bitmap blokları okunuyor, devam-bit zinciri doğru, 19 supported PID, PID 2F destekli). Ancak uygulama bunların tamamını 0 PID olarak görüyordu.

Kök neden: ELM327 init'i (ElmInitSequencer) ATS0 (boşluk kapat) gönderdiği için gerçek adaptörler handshake yanıtını bitişik hex döner ("4100983B001100"). Eski _hexTokens yalnız tam-2-karakter boşlukla-ayrılmış token kabul ediyordu → bitişik akış tek uzun token → filtrelenip atılıyordu → buildHandshakeResult boş üretiyordu → PID 2F oto-aktive olmuyor → yakıt/menzil göstergesi boş. Unit testler yalnız boşluklu fixture kullandığı için yakalanmamıştı.

Gerçek kanıt: Redmi 23090RA98I + BLE OBD (motor çalışır), CDP-over-adb ile canlı performHandshake() ham raw0100="4100983B001100" → eski parser 0 PID, yeni parser 19 PID (2F dahil). docs-local/device-runs/20260713T200929-pr88-handshake-validation/.

Değişiklik (minimal — yalnız parser)

_hexTokens artık her boşlukla-ayrılmış parçayı 2'şer bayta böler; TAM hex + ÇİFT uzunluk şartı (odd/geçersiz → fail-soft atılır). Boşluklu (ATS1) format aynen çalışır. Başka hiçbir davranış (VIN/bitmap/timeout/native/poll/discovery) değişmedi.

Test

Yeni obdHandshakeHexTokens.regression.test.ts — 15 senaryo: spaced · compact · lowercase · mixed-whitespace · CRLF · invalid hex · odd length · empty + gerçek RAW_HANDSHAKE.json fixture + boşluklu-parite + VIN fail-soft. Mevcut 14 handshake testi bozulmadı.

  • tsc -b: temiz · ESLint: 0 error · Full suite: 3849 yeşil (+15) · production build: OK

Not

🤖 Generated with Claude Code

…88 device)

KÖK NEDEN: ELM327 init (ElmInitSequencer) `ATS0` (boşluk kapat) gönderdiği için
gerçek adaptörler handshake bitmap yanıtını BİTİŞİK hex döner ("4100983B001100").
Eski `_hexTokens` yalnız TAM-2-karakter boşlukla-ayrılmış token kabul ediyordu →
bitişik akış tek uzun token → filtreleniyordu → buildHandshakeResult BOŞ üretiyordu
→ supportedPids boş → PID 2F oto-aktive OLMUYOR → yakıt/menzil göstergesi boş.
Unit testler yalnız boşluklu fixture kullandığı için yakalanmamıştı (test-gerçek uçurumu).

Gerçek araç kanıtı (Redmi 23090RA98I + BLE OBD, motor çalışır, CDP-over-adb):
performHandshake ham = raw0100 "4100983B001100" ... → eski parser 0 PID; yeni parser
19 PID (2F dahil). docs-local/device-runs/20260713T200929-pr88-handshake-validation.

DEĞİŞİKLİK (minimal, yalnız parser):
- _hexTokens artık her boşlukla-ayrılmış parçayı 2'şer bayta böler; TAM hex + ÇİFT
  uzunluk şartı (odd/geçersiz → fail-soft atılır). Boşluklu (ATS1) format AYNEN çalışır.
- Başka hiçbir davranış değişmedi (VIN/bitmap/timeout/native/poll dokunulmadı).

Test: obdHandshakeHexTokens.regression.test.ts (15 senaryo: spaced/compact/lowercase/
mixed-ws/CRLF/invalid/odd/empty + gerçek RAW_HANDSHAKE.json fixture + boşluklu parite +
VIN fail-soft). Mevcut 14 handshake testi bozulmadı. Full suite 3849 yeşil, tsc/lint temiz.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X7iTVfDmg22hq3fe9S25mj
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
car-launcher-pro Ready Ready Preview, Comment Jul 13, 2026 5:56pm
carospro Ready Ready Preview, Comment Jul 13, 2026 5:56pm

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.

1 participant