19 Commits

Author SHA1 Message Date
metatroncubeswdev
ba79775fbc Fix DTC tables and Clear DTC result; auto-set ECU type from adapter name
- Rewrite S300 and KPro DTC tables from hvbt_protocol.pdf (the previous
  tables did not match the PDF; e.g. ERR01.6 is P0350 IGM, not P1361).
- Clear DTC: the adapter never echoes the documented ack, but the ECU does
  clear (bench: 3 of 4 codes cleared, P0350 re-set at once as an active
  fault). Judge success from the live ERR bytes; wait only 0.6 s for the
  ack so polling resumes, and report "N of M cleared".
- Set the ECU protocol from the adapter name (S300/KPro) on connect; a
  stale KPro setting made an S300 adapter look unresponsive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:08:29 -04:00
metatroncubeswdev
2bd937aca5 Untrack JVM crash logs and ignore reference PDFs
The logs were already listed in .gitignore but had been committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:03:00 -04:00
metatroncubeswdev
9a56baef61 Rework BT poller and S300 decoding after client feedback
Client reported crashes, wrong/frozen data and that the app floods the
adapter MCU. See docs/FIX_2026-10-12.md for the full analysis.

- Poller: strictly one request outstanding; next request only after a valid
  128-byte reply or a 500 ms timeout, then a quiet period + buffer flush.
  Default 100 ms (10 Hz), minimum 80 ms. DTC clear/probe share the same lock.
- BtNotifier: filter the adapter's default (no-ECU-data) frame instead of
  holding last values; EcuDataStatus + status banner; auto-reconnect on link
  loss, stalls or long default-only runs (rate-limited). A reconnect still in
  flight when the user disconnects is discarded.
- S300 offsets corrected by column counting (trims, PA, ERR00-03, Eth, SW5,
  AF); INJ/AIN little-endian; fan = SW5 FANC only. Default-frame detection
  requires bytes 0-16 and 32-36.
- KPro RPM/MAP2/AIN little-endian (RPM still needs a bench check).
- Crash hardening: zone/Flutter/platform error handlers to an in-app log
  (copyable from Debug); permissions requested before listing devices.
- Remove temporary debug prints; graph redraws live; polling options
  100-300 ms, persisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:02:54 -04:00
metatroncubeswdev
e9b1c0f8fd Fuel pump flag, confirmed ECT/IAT/BAT offsets, persisted ECU type
Work that was previously only in the local working tree:
- Rename fuelCut -> fuelPump (SW2 bit2, active-low, live-confirmed)
- ECT/IAT/BAT moved to live-confirmed offsets 33/34/36
- S300 template-frame detection with hold-last-good logic
- Persist ECU type in SharedPreferences; drop per-connect protocol dialog
- Official-protocol probe and DTC clear on the debug/DTC screens
- Sanity clamp for multi-byte fields; scrollable vertical dashboard
- docs/HANDOFF.md

Includes temporary [DBG]/[KDBG] prints, removed in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:02:05 -04:00
metatroncubeswdev
77a47eb938 the working code s300, with few glitch by resetting to 0 2026-08-08 13:18:02 -04:00
HVBT Dev
375c2510ae Handle S300 alternate tail RPM frames 2026-07-28 02:31:02 +05:30
HVBT Dev
c2f92db217 Calibrate S300 tail RPM decode 2026-07-28 01:35:04 +05:30
HVBT Dev
ba578a0b69 Decode S300 tail payload RPM 2026-07-28 01:31:10 +05:30
HVBT Dev
80167fd9e5 Restore S300 frame parsing for prefix frames 2026-07-28 01:29:12 +05:30
HVBT Dev
5df3442523 Skip S300 placeholders after raw receipt 2026-07-28 01:20:56 +05:30
HVBT Dev
2b537728dc Filter S300 placeholder frames 2026-07-28 01:08:17 +05:30
HVBT Dev
74476afc45 Improve live S300 update responsiveness 2026-07-27 00:25:39 +05:30
HVBT Dev
0886bef200 Accept live S300 frames with bad checksum 2026-07-27 00:23:33 +05:30
HVBT Dev
1424cafbb4 Fix S300 live data decoding 2026-07-26 23:51:56 +05:30
HVBT Dev
763821171c feat: Add ECU Frame Debug Screen and DTC Screen
- Implemented RawFrameDebugScreen for displaying ECU frame data and diagnostics.
- Created DtcScreen to show active Diagnostic Trouble Codes (DTCs) with detailed descriptions.
- Added DtcRow widget for individual DTC representation.
- Introduced GraphScreen for visualizing sensor data over time with customizable time windows.
- Developed SensorListScreen to display available sensors and their current values.
- Enhanced SettingsScreen with options for Bluetooth connection, ECU protocol selection, polling interval, and theme settings.
- Added AppColors and AppTheme for consistent theming across the application.
- Implemented BtStatusChip to show Bluetooth connection status in the app bar.
- Created RecordFab for starting and stopping data recording sessions.
2026-07-26 23:14:58 +05:30
HVBT Dev
9e5e6a53c7 first commit 2026-06-04 18:34:50 +05:30
HVBT Dev
332dd6209e v1.3.0 — Phase 3: SQLite datalog (DB + recorder + player + providers)
- datalog_session.dart: DatalogSession model with toMap/fromMap, duration helpers
- datalog_db.dart: SQLite schema (sessions + frames tables), batch insertFrames,
  getSessions, getFrames, deleteSession, closeSession
- datalog_recorder.dart: listens to raw frame stream, buffers PendingFrames,
  flushes to DB every 500ms via Timer, finalises session on stop()
- datalog_player.dart: loads StoredFrames from DB, replays at original timing
  adjusted by speed multiplier (0.25x–8x), play/pause/stop/seek, onProgress cb
- datalog_provider.dart: datalogDbProvider, datalogRecorderProvider,
  datalogPlayerProvider singletons; RecordingNotifier (idle/recording state);
  sessionListProvider FutureProvider; PlaybackNotifier with full playback state
- pubspec.yaml: added path ^1.9.0 dependency
2026-04-13 20:42:26 +05:30
HVBT Dev
6a80d8fc1f v1.2.0 — Phase 2: Riverpod providers wired up
- settings_provider: AppSettings (ecuType, pollingInterval) StateNotifier
- bt_provider: BtNotifier (disconnected/connecting/connected/error states),
  btServiceProvider singleton, pairedDevicesProvider FutureProvider,
  internal frameStream piped through StreamController
- sensor_provider: sensorStateProvider StreamProvider (auto S300/KPro),
  latestSensorProvider convenience Provider
- theme_provider: AppThemeVariant (red/green × dark/light) StateNotifier
- main.dart: fully Riverpod — ProviderScope, ConsumerWidget throughout,
  no setState for BT state, providers own all lifecycle
2026-04-13 20:13:32 +05:30
HVBT Dev
11cf7c2b63 v1.0.1 — Phase 1 complete + BT connection test UI
- Phase 1 core protocol: temp_table, neg8, sensor_state, s300_parser,
  kpro_parser, dtc_map, sensor_defs (50/50 tests passing)
- BT layer: bt_service.dart, bt_poller.dart (100ms poll, NEG8 validation)
- Connection test UI: device picker, protocol selector, live sensor screen
  with LIVE DATA + DEBUG LOG tabs
- Runtime BT permission request (Android 12+) + auto-enable Bluetooth
- Android: minSdk=26, all BT+location permissions in manifest
- Fixed flutter_bluetooth_serial namespace for AGP compatibility
2026-04-12 18:07:37 +05:30