- 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
42 lines
2.8 KiB
Dart
42 lines
2.8 KiB
Dart
import 'sensor_def.dart';
|
|
import 'flag_def.dart';
|
|
|
|
/// Master list of all analog sensor definitions.
|
|
const List<SensorDef> sensorDefs = [
|
|
SensorDef(id: 'rpm', displayName: 'RPM', unit: 'revs', min: 0, max: 9000),
|
|
SensorDef(id: 'vss', displayName: 'Speed', unit: 'km/h', min: 0, max: 280),
|
|
SensorDef(id: 'map', displayName: 'Manifold pressure', unit: 'kPa', min: 0, max: 300),
|
|
SensorDef(id: 'tps', displayName: 'Throttle pedal', unit: '%', min: 0, max: 100),
|
|
SensorDef(id: 'inj', displayName: 'Injector duration', unit: 'ms', min: 0, max: 20),
|
|
SensorDef(id: 'ign', displayName: 'Timing advance', unit: 'deg', min: -20, max: 60),
|
|
SensorDef(id: 'ect', displayName: 'Coolant temp', unit: '°C', min: -40, max: 150),
|
|
SensorDef(id: 'iat', displayName: 'Intake air temp', unit: '°C', min: -40, max: 150),
|
|
SensorDef(id: 'bat', displayName: 'Battery voltage', unit: 'V', min: 0, max: 20),
|
|
SensorDef(id: 'o2', displayName: 'O2 sensor', unit: 'V', min: 0, max: 1.5),
|
|
SensorDef(id: 'gear', displayName: 'Gear', unit: '—', min: 1, max: 6),
|
|
SensorDef(id: 'eth', displayName: 'Ethanol', unit: '%', min: 0, max: 100),
|
|
SensorDef(id: 'pa', displayName: 'Baro pressure', unit: 'kPa', min: 0, max: 120),
|
|
SensorDef(id: 'afr', displayName: 'AFR', unit: 'λ', min: 0.5, max: 2.0),
|
|
SensorDef(id: 'strim', displayName: 'Short trim', unit: '%', min: -30, max: 30),
|
|
SensorDef(id: 'ltrim', displayName: 'Long trim', unit: '%', min: -30, max: 30),
|
|
SensorDef(id: 'ain0', displayName: 'Analog input 0', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain1', displayName: 'Analog input 1', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain2', displayName: 'Analog input 2', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain3', displayName: 'Analog input 3', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain4', displayName: 'Analog input 4', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain5', displayName: 'Analog input 5', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain6', displayName: 'Analog input 6', unit: 'V', min: 0, max: 5),
|
|
SensorDef(id: 'ain7', displayName: 'Analog input 7', unit: 'V', min: 0, max: 5),
|
|
];
|
|
|
|
/// Master list of boolean flag sensors.
|
|
const List<FlagDef> flagDefs = [
|
|
FlagDef(id: 'mil', displayName: 'MIL'),
|
|
FlagDef(id: 'fuelcut', displayName: 'Fuel Cut'),
|
|
FlagDef(id: 'fanout', displayName: 'FAN Out'),
|
|
FlagDef(id: 'vtec', displayName: 'VTEC'),
|
|
FlagDef(id: 'knock', displayName: 'Knock'),
|
|
FlagDef(id: 'revlimit', displayName: 'Rev Limit'),
|
|
FlagDef(id: 'launch', displayName: 'Launch'),
|
|
];
|