Skip to content

Signal map

The SignalId enum is the integer key into SignalStore. Every signal the firmware understands has a stable id; the on-disk signals.json maps frame bytes onto these ids.

Adding a new signal: bump the enum in canshift-firmware/include/signal_map.h, add the name → id row in canshift-firmware/src/can/signal_map.cpp::kNameToId, mirror the entry in the Rust crate (rust/signal-map/src/lib.rs), and add the visual mapping in canshift-core. Source of truth across both languages — Unity tests pin the ids; cargo tests pin them on the Rust side.

Engine

idNameUnitSource
0rpmRPMbroadcast or OBD-II mode 01 PID 0C
1throttle_pos%OBD-II PID 11
2map_kpakPaOBD-II PID 0B
3boost_barbarderived / broadcast
4iat_c°COBD-II PID 0F

Temperatures

idNameUnitSource
5coolant_temp_c°COBD-II PID 05
6oil_temp_c°Cbroadcast

Pressures

idNameUnitSource
7oil_press_barbarbroadcast
8fuel_press_barbarbroadcast

Fuelling

idNameUnitSource
9lambda_1λwideband O₂
10afr_1AFRderived from lambda_1 × stoichiometry

Vehicle

idNameUnitSource
11speed_kphkm/hOBD-II PID 0D
12gear(number)broadcast

Electrical

idNameUnitSource
13battery_voltsVOBD-II PID 42

ECU status flags

idNameSource
20flag_milMIL bit on the OBD-II status frame
21flag_launch_ctrlbroadcast
22flag_flat_shiftbroadcast
23flag_anti_lagbroadcast
24flag_traction_cutbroadcast

Map / profile

idNameSource
30map_numberbroadcast
31map_name_idxbroadcast

Lap timer

idNameUnitSource
40lap_timer_msmsbroadcast or canshift-mobile push

Numeric gaps

The gaps (15..19, 25..29, 32..39, 41..63) are intentional — they reserve room for future signals in each semantic band without renumbering existing ids. SIGNAL_COUNT = 64 is the sentinel for unknown name.

Signal lifecycle

Every signal goes through SignalStore, which holds the latest raw value, an EMA-smoothed value, a last-update timestamp, and a valid flag. The store invalidates entries older than SIGNAL_DEFAULT_TIMEOUT_MS = 1000 (default; per-signal override in signals.json).

Details in SignalStore.