Implement a modular vehicle decoding system

- Add Komatsu specific rules
- Possibility to expand to any brand
This commit is contained in:
2026-07-23 00:03:00 +02:00
parent fab448785b
commit dd38751a7c
4 changed files with 253 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
# 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)