Implement a modular vehicle decoding system
- Add Komatsu specific rules - Possibility to expand to any brand
This commit is contained in:
@@ -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="Engine RPM",
|
||||
bit_start=0,
|
||||
bit_length=8,
|
||||
factor=20.0,
|
||||
offset=0.0,
|
||||
is_signed=False,
|
||||
byte_order="little",
|
||||
unit="rev/min",
|
||||
),
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
def decode_dataframe(df, can_id):
|
||||
return _decode_dataframe(df, can_id, DECODER_RULES)
|
||||
Reference in New Issue
Block a user