Files
CANveyor/vehicle/komatsu.py
T
eeeck dd38751a7c Implement a modular vehicle decoding system
- Add Komatsu specific rules
- Possibility to expand to any brand
2026-07-23 00:03:00 +02:00

30 lines
750 B
Python

# File: vehicle/komatsu.py
# Copyright (C) 2026 Erick Ahmed
# SPDX-License-Identifier: AGPL-3.0-or-later
from vehicle.base import (
SignalDef, FrameDef, normalize_id, decode_dataframe as _decode_dataframe, plot_signal
)
DECODER_RULES = {
normalize_id("0x011F"): FrameDef(
can_id="0x011F",
description="Engine RPM",
signals=[
SignalDef(
name="RPM",
bit_start=0,
bit_length=8,
factor=20.0,
offset=0.0,
is_signed=False,
byte_order="little",
unit="rpm",
),
],
),
}
def decode_dataframe(df, can_id):
return _decode_dataframe(df, can_id, DECODER_RULES)