/** * CAN message handlers for decoding binary CAN payloads. * * All byte positions and formulas verified against native library * via radare2 disassembly. */ import type { ChannelState } from './types.js'; /** * Parse CAN message 0x0209: Engine RPM and Gear. * * Extracts RPM from bytes 0-1 (big-endian uint16) and gear from byte 4 * (lower 3 bits). Gear value 7 is rejected as invalid (gear transition). * * @param data - CAN payload bytes (minimum 5 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0209(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x0215: Throttle and Electronic Controls. * * Extracts: * - TPS (Throttle Position Sensor) from bytes 0-1 * - APS (Accelerator Position Sensor) from bytes 2-3 * - Launch control status from byte 6 bits 5-6 * - TCS, SCS, LIF status from byte 7 bits 3-5 * * @param data - CAN payload bytes (minimum 8 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0215(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x023E: Temperature and Fuel. * * Extracts: * - Water temperature from byte 0 (single byte, NOT uint16) * - Intake air temperature from byte 1 (single byte) * - Fuel consumption delta from bytes 2-3 (big-endian uint16) * * The fuel value is a delta that must be accumulated. * * @param data - CAN payload bytes (minimum 4 bytes required) * @param state - Mutable state object to update with parsed values * @param fuelAcc - Mutable object with fuel accumulator { value: number } */ export declare function parseCan0x023e(data: Uint8Array, state: ChannelState, fuelAcc: { value: number; }): void; /** * Parse CAN message 0x0250: Acceleration. * * Extracts longitudinal (X) and lateral (Y) acceleration from bytes 0-3. * Both values are big-endian uint16. * * @param data - CAN payload bytes (minimum 4 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0250(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x0258: IMU (Lean and Pitch). * * Extracts: * - Lean angle from bytes 0-3 using special packed format with deadband * - Pitch rate from bytes 6-7 (big-endian uint16) * * The lean angle uses a complex algorithm with: * 1. Nibble interleaving across bytes 0-3 * 2. Deviation from center (9000 = upright) * 3. Deadband: deviations <= 499 treated as upright * 4. Truncation to nearest 100 (floor, not round) * * @param data - CAN payload bytes (minimum 8 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0258(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x0260: Brake Pressure. * * Extracts front and rear brake hydraulic pressure from bytes 0-3. * Both values are big-endian uint16. * * @param data - CAN payload bytes (minimum 4 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0260(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x0264: Wheel Speed. * * Extracts front and rear wheel speed from bytes 0-3. * Both values are big-endian uint16. * * @param data - CAN payload bytes (minimum 4 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0264(data: Uint8Array, state: ChannelState): void; /** * Parse CAN message 0x0268: ABS Status. * * Extracts front and rear ABS active flags from byte 4. * R_ABS is bit 0, F_ABS is bit 1 (counterintuitive order). * * @param data - CAN payload bytes (minimum 5 bytes required) * @param state - Mutable state object to update with parsed values */ export declare function parseCan0x0268(data: Uint8Array, state: ChannelState): void; /** * CAN handler dispatch table. * Maps CAN ID to handler function. */ export declare const CAN_HANDLERS: { [key: number]: (data: Uint8Array, state: ChannelState) => void; }; //# sourceMappingURL=can-handlers.d.ts.map