From 183ba117ae48dcfca9eeac11f4138c8bc2c998cc Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Fri, 12 Apr 2024 15:00:42 -0700 Subject: [PATCH 1/4] Add code generation from files --- scantool/scantool_850.c | 1 + scantool/scantool_850/parser.py | 158 ++++++++++++++++++ scantool/scantool_850/templates/dtc.mustache | 1 + .../scantool_850/templates/dtc_list.mustache | 4 + scantool/scantool_850/templates/ecu.mustache | 4 + .../scantool_850/templates/prefix.mustache | 6 + .../scantool_850/templates/suffix.mustache | 6 + 7 files changed, 180 insertions(+) create mode 100644 scantool/scantool_850/parser.py create mode 100644 scantool/scantool_850/templates/dtc.mustache create mode 100644 scantool/scantool_850/templates/dtc_list.mustache create mode 100644 scantool/scantool_850/templates/ecu.mustache create mode 100644 scantool/scantool_850/templates/prefix.mustache create mode 100644 scantool/scantool_850/templates/suffix.mustache diff --git a/scantool/scantool_850.c b/scantool/scantool_850.c index 1caa2fc..6bb5488 100644 --- a/scantool/scantool_850.c +++ b/scantool/scantool_850.c @@ -54,6 +54,7 @@ #include "scantool_850/dtc.h" #include "scantool_850/ecu.h" +#include "scantool_850/xiaotec.h" static bool have_read_dtcs = false; static struct diag_msg *ecu_id = NULL; diff --git a/scantool/scantool_850/parser.py b/scantool/scantool_850/parser.py new file mode 100644 index 0000000..1b9d6ff --- /dev/null +++ b/scantool/scantool_850/parser.py @@ -0,0 +1,158 @@ +import sys +import re + +# a class representing an OBD-II Diagnostic Trouble Code (DTC) +class dtc: + # constructor + def __init__(self, ecu, code, prefix, suffix, description): + self.code = code + self.description = description + self.ecu = ecu + self.prefix = prefix + self.suffix = suffix + +# this loads dtcs from the xiaotec file export +def load_dtcs(file_path): + dtcs = [] + + with open(file_path, 'r') as file: + ecu_addr = 0 + ecu_description = '' + strings = {} + for line in file: + # regular expression to match 01 - description + match = re.match(r'([0-9A-F][0-9A-F]) - (.+)', line.strip()) + if match: + ecu_addr = match.groups()[0] + ecu_description = match.groups()[1] + # print(ecu_addr) + + # regular expression to match dtc.contains("") once + match = re.match(r'^if \(dtc.contains\("([0-9A-F]+)"\)\) ?// ?([^\-]+)\-?([0-9]+) ?\(?([a-z])?\)?', line.strip()) + if match: + string_key = match.groups()[2] + if match.groups()[3]: + string_key += match.groups()[3] + dtcs.append(dtc(ecu_addr, match.groups()[0], match.groups()[1], match.groups()[2].strip(), string_key)) + + # regular expression to match dtc.contains("") twice + match = re.match(r'^if \(dtc.contains\("([0-9A-F]+)"\) ?\|\| ?dtc.contains\("([0-9A-F]+)"\)\) ?// ?([^\-]+)\-?([0-9]+) ?\(?([a-z])?\)?', line.strip()) + if match: + string_key = match.groups()[2] + if match.groups()[3]: + string_key += match.groups()[3] + dtcs.append(dtc(ecu_addr, match.groups()[0], match.groups()[2], match.groups()[3], string_key)) + dtcs.append(dtc(ecu_addr, match.groups()[1], match.groups()[2], match.groups()[3], string_key)) + + match = re.match(r'(.+)', line.strip()) + if match: + if not ecu_addr in strings: + strings[ecu_addr] = {} + strings[ecu_addr][match.groups()[0]] = match.groups()[1] + + for d in dtcs: + key = d.prefix + d.suffix + ecu_key = d.ecu + if ecu_key == '2E': + ecu_key = '2F' + if ecu_key in strings: + string_list = strings[ecu_key] + if key in string_list: + d.description = string_list[key] + # Special case for motronic 4.4 + elif key + '_7A' in string_list: + d.description = string_list[key + '_7A'] + # Special case for EMS ECU + elif 'V_' + key in string_list: + d.description = string_list['V_' + key] + else: + print('No description found for ' + key) + else: + print('No ecu found for: "%s"' % ecu_key) + + d.description = escape(d.description) + + return dtcs + + +def escape(description): + return description.replace('"', '\\"') + +# write a function to parse the DTCs from a text file and return a list of DTCs +def parse_dtc_file(file_path): + dtcs = [] + with open(file_path, 'r') as file: + for line in file: + match = re.match(r'([0-9]+) ([0-9A-F]+) ([A-Z]+)\-([0-9]+) (.+)', line.strip()) + if match: + # construct a dtc object from match and append it to the list + dtcs.append(dtc(match.groups()[0], match.groups()[1], match.groups()[2], match.groups()[3], escape(match.groups()[4]))) + return dtcs + +# a function that takes a dtc object and a pointer to a mustach file and writes the dtc to the file +def write_dtc_to_mustache(dtc, template): + # substitute the fields of the dtc object into the template + template = template.replace('{{ecu}}', dtc.ecu) + template = template.replace('{{code}}', dtc.code) + template = template.replace('{{prefix}}', dtc.prefix) + template = template.replace('{{suffix}}', dtc.suffix) + template = template.replace('{{description}}', dtc.description) + + return template + +# a function that given a list of dtcs groups them into a map by ecu +def group_dtcs_by_ecu(dtcs): + ecu_map = {} + for dtc in dtcs: + if dtc.ecu not in ecu_map: + ecu_map[dtc.ecu] = [] + ecu_map[dtc.ecu].append(dtc) + return ecu_map + + +# write a main function to call the parse_dtc_file function with a file from the first argument +def main(): + if len(sys.argv) != 4: + print('Usage: python parser.py ') + sys.exit(1) + # raw_dtcs = parse_dtc_file(sys.argv[1]) + raw_dtcs = load_dtcs(sys.argv[1]) + ecu_map = group_dtcs_by_ecu(raw_dtcs) + + directory = sys.argv[2] + name = sys.argv[3] + + with (open(directory + '/dtc.mustache', 'r') as dtc_template_file, + open(directory + '/dtc_list.mustache', 'r') as dtc_list_template_file, + open(directory + '/ecu.mustache', 'r') as ecu_template_file, + open(directory + '/prefix.mustache', 'r') as prefix_template_file, + open(directory + '/suffix.mustache', 'r') as suffix_template_file): + + prefix_template = prefix_template_file.read() + prefix_template = prefix_template.replace('{{name}}', name.upper()) + print(prefix_template) + + template = dtc_template_file.read() + dtc_list_template = dtc_list_template_file.read() + ecu_template = ecu_template_file.read() + + ecu_list = [] + for ecu in ecu_map.keys(): + out = ecu_template.replace('{{ecu}}', ecu) + out = out.replace('{{dtc_table}}', 'dtc_list_' + ecu.lower()) + ecu_list.append(out) + + dtcs = ecu_map[ecu] + dtc_list = [] + for dtc in dtcs: + dtc_list.append(write_dtc_to_mustache(dtc, template)) + out = dtc_list_template.replace('{{dtc_list}}', '\n'.join(dtc_list)) + out = out.replace('{{dtc_list_name}}', 'dtc_list_' + ecu.lower()) + print(out) + + suffix_template = suffix_template_file.read() + suffix_template = suffix_template.replace('{{name}}', name.upper()) + suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(ecu_list)) + print(suffix_template) + +main() \ No newline at end of file diff --git a/scantool/scantool_850/templates/dtc.mustache b/scantool/scantool_850/templates/dtc.mustache new file mode 100644 index 0000000..d417c68 --- /dev/null +++ b/scantool/scantool_850/templates/dtc.mustache @@ -0,0 +1 @@ + {0x{{code}}, {{suffix}}, "{{description}}", NULL}, \ No newline at end of file diff --git a/scantool/scantool_850/templates/dtc_list.mustache b/scantool/scantool_850/templates/dtc_list.mustache new file mode 100644 index 0000000..da4a501 --- /dev/null +++ b/scantool/scantool_850/templates/dtc_list.mustache @@ -0,0 +1,4 @@ +static struct dtc_table_entry {{dtc_list_name}}[] = { +{{dtc_list}} + {0, 0, NULL, NULL}, +}; \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu.mustache b/scantool/scantool_850/templates/ecu.mustache new file mode 100644 index 0000000..02ce1b2 --- /dev/null +++ b/scantool/scantool_850/templates/ecu.mustache @@ -0,0 +1,4 @@ + { + .ecu_addr = 0x{{ecu}}, + .dtc_table = {{dtc_table}} + }, \ No newline at end of file diff --git a/scantool/scantool_850/templates/prefix.mustache b/scantool/scantool_850/templates/prefix.mustache new file mode 100644 index 0000000..7c6bed2 --- /dev/null +++ b/scantool/scantool_850/templates/prefix.mustache @@ -0,0 +1,6 @@ +#ifndef __SCANTOOL_850_DTC_{{name}}_H__ +#define __SCANTOOL_850_DTC_{{name}}_H__ + +#include +#include "../scantool_850/dtc.h" +#include "../scantool_850/ecu.h" diff --git a/scantool/scantool_850/templates/suffix.mustache b/scantool/scantool_850/templates/suffix.mustache new file mode 100644 index 0000000..3bf58e7 --- /dev/null +++ b/scantool/scantool_850/templates/suffix.mustache @@ -0,0 +1,6 @@ +static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { +{{ecu_list}} + {0, NULL}, +}; + +#endif // __SCANTOOL_850_DTC_{{name}}_H__ \ No newline at end of file From 425147a1d677a0d99b7aa18235c96f9861717a11 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Fri, 12 Apr 2024 15:00:42 -0700 Subject: [PATCH 2/4] Add code generation from files --- scantool/scantool_850.c | 8 + scantool/scantool_850/frobbed.h | 229 ++++++++++ scantool/scantool_850/parser.py | 76 +++- scantool/scantool_850/xiaotec.h | 742 ++++++++++++++++++++++++++++++++ 4 files changed, 1035 insertions(+), 20 deletions(-) create mode 100644 scantool/scantool_850/frobbed.h create mode 100644 scantool/scantool_850/xiaotec.h diff --git a/scantool/scantool_850.c b/scantool/scantool_850.c index 6bb5488..d5601ae 100644 --- a/scantool/scantool_850.c +++ b/scantool/scantool_850.c @@ -54,7 +54,15 @@ #include "scantool_850/dtc.h" #include "scantool_850/ecu.h" +<<<<<<< HEAD #include "scantool_850/xiaotec.h" +======= +#include "scantool_850/basic.h" +// DTC list from richard jones +// #include "scantool_850/frobbed.h" +// DTC list from aleksi (xiaotec) / Android 850 OBD2 app +// #include "scantool_850/xiaotec.h" +>>>>>>> bb7f00f (Add code generation from files) static bool have_read_dtcs = false; static struct diag_msg *ecu_id = NULL; diff --git a/scantool/scantool_850/frobbed.h b/scantool/scantool_850/frobbed.h new file mode 100644 index 0000000..804c7cd --- /dev/null +++ b/scantool/scantool_850/frobbed.h @@ -0,0 +1,229 @@ +#ifndef __SCANTOOL_850_DTC_FROBBED_H__ +#define __SCANTOOL_850_DTC_FROBBED_H__ + +#include +#include "../scantool_850/dtc.h" +#include "../scantool_850/ecu.h" + +static struct dtc_table_entry dtc_list_01[] = { + {0x10, 311, "Left Front Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, + {0x11, 321, "Left Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, + {0x13, 211, "Left Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch].", NULL}, + {0x14, 221, "Left Front Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch].", NULL}, + {0x20, 312, "Right Front Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, + {0x21, 322, "Right Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, + {0x23, 212, "Right Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch].", NULL}, + {0x24, 222, "Right Front Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch].", NULL}, + {0x30, 313, "Left Rear Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, + {0x31, 323, "Left Rear Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, + {0x33, 213, "Left Rear Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch, or stuck emergency brake].", NULL}, + {0x34, 223, "Left Rear Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch].", NULL}, + {0x40, 314, "Right Rear Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, + {0x41, 324, "Right Rear Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, + {0x43, 214, "Right Rear Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch, or stuck emergency brake].", NULL}, + {0x44, 224, "Right Rear Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch].", NULL}, + {0x50, 411, "Left Front Wheel Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x51, 413, "Right Front Wheel Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x52, 421, "Rear Wheels Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x54, 412, "Left Front Wheel Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x55, 414, "Right Front Wheel Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x56, 422, "Rear Wheels Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x60, 423, "TRACS Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch].", NULL}, + {0x61, 424, "??TRACS Pressure Switch, circuit open/short [or bad wiring, hydraulic modulator, brake light switch, ABS module, ignition switch, or blown fuse 12 (STOP LAMPS)]??.", NULL}, + {0x64, 141, "Brake Pedal Sensor, short [or bad ABS module solders, wiring, brake pedal sensor, or ignition switch].", NULL}, + {0x65, 142, "Brake Light/Pedal Switch, open/short or adjustment [or brake light bulb, bad ABS module solders, wiring, or ignition switch].", NULL}, + {0x66, 144, "TRACS Disengaged to Avoid Front Brake Discs Overheating [or bad ABS module solders or ignition switch].", NULL}, + {0x67, 143, "??Missing or Faulty Vehicle Speed Signal from ABS module?? [or bad ABS module solders, ABS module memory fault, or otherwise faulty ABS module or ignition switch].", NULL}, + {0x70, 443, "Pump motor fault [or fuse 9 (ABS PUMP MOTOR), pump power plug not seated properly, bad wiring (eg, insulation that falls off, any short/open), bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module].", NULL}, + {0x72, 431, "ABS Module, general hardware fault [or bad ABS module solders or ignition switch].", NULL}, + {0x75, 432, "ABS Module, general interference fault [or bad ABS module solders or ignition switch] [see \"https://www.matthewsvolvosite.com/forums/viewtopic.php?f=1&t=78577&start=30#p428745\"].", NULL}, + {0x77, 433, "Battery Voltage, ?too high?.", NULL}, + {0x80, 441, "ABS Microprocessors, redundant calculations mismatch [or fuse 14 (ABS MAIN SUPPLY), bad ABS module solders, wheel sensor wiring close to interference, ignition switch, or bad ABS module].", NULL}, + {0x81, 444, "??ABS Module, internal valve reference voltage error or no power to hydraulic valves [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??.", NULL}, + {0x82, 442, "??ABS Module, leakage current or Hydraulic Modulator Pump Pressure, too low [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??.", NULL}, + {0x83, 445, "??ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??.", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_11[] = { + {0x00, 131, "Engine Speed (RPM) signal.", NULL}, + {0x01, 719, "Secondary Engine Speed signal.", NULL}, + {0x02, 132, "Battery Voltage.", NULL}, + {0x03, 711, "Needle Lift sensor signal.", NULL}, + {0x04, 732, "Accelerator Pedal Position sensor signal.", NULL}, + {0x05, 123, "Engine Coolant Temp (ECT) sensor signal.", NULL}, + {0x06, 122, "Intake Air Temp (IAT) sensor signal.", NULL}, + {0x08, 712, "Fuel Temp sensor signal.", NULL}, + {0x09, 415, "Boost Pressure sensor signal.", NULL}, + {0x0A, 112, "Fault in Engine Control Module (ECM) Barometric Pressure signal.", NULL}, + {0x0B, 121, "Mass Air Flow (MAF) sensor signal.", NULL}, + {0x0C, 743, "Cruise Control switch signal.", NULL}, + {0x0D, 112, "Fault in Engine Control Module (ECM) Reference Voltage.", NULL}, + {0x0F, 112, "Fault in Engine Control Module (ECM).", NULL}, + {0x10, 311, "Vehicle Speed signal too high [neither cruise control nor A/C will activate, possibly due to VSS fault, COMBI->ECM fault, or COMBI fault] [see OTP 850 DVD]; else Engine RPM vs. Vehicle Speed signal discrepancy [derived from old \"www.volvopedia.de/index.php?title=MSA 15.7\"].", NULL}, + {0x11, 235, "Exhaust gas recirculation (EGR) controller signal.", NULL}, + {0x12, 242, "Turbocharger Control Valve (TCV) signal.", NULL}, + {0x14, 515, "Engine Coolant Fan, high speed signal.", NULL}, + {0x19, 713, "Injection Timing, Advance Control Valve signal.", NULL}, + {0x1A, 323, "CHECK ENGINE light (CEL) / Malfunction indicator lamp (MIL).", NULL}, + {0x1B, 721, "Glowplug Indicator Light signal.", NULL}, + {0x20, 714, "Fuel Shut-off Valve signal.", NULL}, + {0x21, 730, "Brake Pedal Switch signal.", NULL}, + {0x22, 731, "Clutch Switch signal.", NULL}, + {0x23, 724, "Engine Coolant Heater Relay signal.", NULL}, + {0x24, 112, "Memory Fault (ROM) In Engine Control Module (ECM).", NULL}, + {0x26, 514, "Engine Coolant Fan, low speed signal.", NULL}, + {0x2A, 725, "Main Relay signal.", NULL}, + {0x2B, 715, "Fuel Regulation.", NULL}, + {0x2D, 726, "Terminal 15-supply to Engine Control Module (ECM).", NULL}, + {0x2E, 716, "Fuel Quantity Actuator signal.", NULL}, + {0x2F, 718, "Ignition Timing Control.", NULL}, + {0x30, 335, "Request for MIL lighting from TCM [or possibly Comm Failure between MSA 15.7 ECM and AW 50-42 TCM] [see OTP 850 DVD].", NULL}, + {0x31, 353, "Comm Failure with Immobilizer.", NULL}, + {0x32, 742, "Comm Failure between MSA 15.7 ECM and AW 50-42 TCM [or possibly Request for MIL lighting from TCM] [see OTP 850 DVD].", NULL}, + {0x33, 225, "A/C Pressure sensor signal.", NULL}, + {0x34, 717, "Fuel Quantity Regulator Position sensor signal.", NULL}, + {0x36, 732, "Accelerator pedal position sensor signal.", NULL}, + {0xFE, 131, "Engine Speed (RPM) signal.", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_29[] = { + {0x30, 314, "Passenger side temp damper motor, no position change [according to xiaotec \"850 OBD-II\" V1.2.9 app]; or might be Floor/Defrost Damper Motor Shorted To Ground Or Power [see \"ac heater system auto.pdf\"].", NULL}, + {0x35, 412, "Driver's (or passenger's) side interior temperature sensor inlet fan shorted to earth (or signal too low) [see \"ac heater system auto.pdf\"].", NULL}, + {0x36, 413, "Driver's (or passenger's) side interior temperature sensor inlet fan, no control voltage (or signal too high) [see \"ac heater system auto.pdf\"].", NULL}, + {0x37, 414, "Driver's (or passenger's) side interior temperature sensor inlet fan seized (or open/short circuit or faulty signal) [carefully clean out any lint from temp sensor fan(s)]; else (inlet)Fan motor passenger comp (interior) temp sensor, Faulty Signal [according to xiaotec \"850 OBD-II\" V1.3.4 app].", NULL}, + {0x38, 411, "Blower fan seized or drawing excess current [or blower fan obstruction, or power stage surge protector problem (ECC-419)].", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_41[] = { + {0x01, 112, "Internal EEPROM memory fault.", NULL}, + {0x06, 223, "Comm fault from Transponder to IMMO Control Module.", NULL}, + {0x07, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, + {0x32, 324, "VERLOG code missing.", NULL}, + {0x34, 121, "PIN programming failed.", NULL}, + {0x35, 225, "Key Code verification failed.", NULL}, + {0x36, 132, "No Key Codes in EEPROM.", NULL}, + {0x37, 122, "New replacement Immobilizer not yet programmed.", NULL}, + {0x38, 999, "?EEPROM error?.", NULL}, + {0x51, 311, "Comms with engine ECU, short to supply in comm link 2 or 4.", NULL}, + {0x52, 312, "Comms with engine ECU, short to ground in comm link 2 or 4.", NULL}, + {0x53, 214, "Comms from engine ECU, wrong MIN code (ie, Immobilizer is programmed for a different engine ECU).", NULL}, + {0x54, 321, "Initiating signal from ECM, missing.", NULL}, + {0x55, 326, "Reply signal from engine control module.", NULL}, + {0xF7, 333, "Control circuit to VGLA, fault in VGLA or LED circuit.", NULL}, + {0xF8, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_51[] = { + {0x01, 222, "Vehicle Speed Signal too high.", NULL}, + {0x02, 221, "Vehicle Speed Signal missing [usually due to bad ABS module solders] [P0500].", NULL}, + {0x03, 114, "Fuel Level sensor stuck / signal constant for 94 miles.", NULL}, + {0x04, 112, "Fuel Level signal short to ground.", NULL}, + {0x05, 113, "Low Fuel / Fuel Level signal interrupted.", NULL}, + {0x06, 121, "Engine Coolant Temperature signal faulty [see \"http://www.volvotips.com/index.php/850-2/volvo-850-s70-v70-c70-service-repair-manual/volvo-850-instrument-panel-service-repair-manual/\"].", NULL}, + {0x07, 123, "48-pulse output Speed Signal short to supply.", NULL}, + {0x08, 143, "48-pulse output Speed Signal short to ground.", NULL}, + {0x09, 131, "12-pulse output Speed Signal short to supply.", NULL}, + {0x0A, 141, "12-pulse output Speed Signal short to ground.", NULL}, + {0x0B, 132, "Engine RPM signal missing.", NULL}, + {0x0C, 124, "Engine RPM signal faulty.", NULL}, + {0x0D, 211, "D+ alternator voltage signal missing (or too low) for >= 10 sec when > 1000 RPM.", NULL}, + {0x0E, 133, "Fuel Level Signal To Trip Computer short to supply.", NULL}, + {0x0F, 142, "Ambient Temperature signal missing.", NULL}, + {0x10, 231, "COMBI microprocessor internal fault.", NULL}, + {0x11, 174, "Wide Disparity in Fuel Levels and/or Fuel Consumption signal missing [DTC rarely seen; (in 850 especially) DTC 11 Freeze Frame sometimes precedes a Low Fuel situation, occasionally follows a Fillup, and oftentimes persists after clearing COMBI DTCs].", NULL}, + {0x20, 232, "COMBI is not yet programmed.", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_58[] = { + {0x01, 112, "Crash Sensor Module internal fault.", NULL}, + {0x02, 211, "Driver Airbag short circuit (in contact reel and/or in SRS harness to airbag, connectors, or igniter).", NULL}, + {0x03, 212, "Driver Airbag open circuit (in SRS harness, connector, or airbag).", NULL}, + {0x04, 213, "Driver Airbag short circuit to ground (in contact reel, airbag, wiring harness, or connectors).", NULL}, + {0x05, 214, "Driver Airbag short circuit to supply (in contact reel, airbag, wiring harness, or connectors).", NULL}, + {0x06, 221, "Passenger Airbag short circuit (in SRS harness to airbag, connectors, or igniter).", NULL}, + {0x07, 222, "Passenger Airbag open circuit (in SRS harness, connector, or airbag).", NULL}, + {0x08, 223, "Passenger Airbag short circuit to ground (in airbag, wiring harness, or connectors).", NULL}, + {0x09, 224, "Passenger Airbag short circuit to supply (in airbag, wiring harness, or connectors).", NULL}, + {0x0A, 231, "Left Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter).", NULL}, + {0x0B, 232, "Left Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner).", NULL}, + {0x0C, 233, "Left Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors).", NULL}, + {0x0D, 234, "Left Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors).", NULL}, + {0x0E, 241, "Right Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter).", NULL}, + {0x0F, 242, "Right Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner).", NULL}, + {0x10, 243, "Right Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors).", NULL}, + {0x11, 244, "Right Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors).", NULL}, + {0x52, 127, "SRS Warning Light short circuit to ground or open circuit [see sections \"FAULT CODE 1-2-7\" and \"SRS WARNING LIGHT WILL NOT COME ON\" in \"air bag restraint system.pdf\" of \"https://www.matthewsvolvosite.com/downloads/Volvo_850.zip\"].", NULL}, + {0x53, 128, "SRS Warning Light short circuit to supply [see sections \"FAULT CODE 1-2-7\" and \"SRS WARNING LIGHT WILL NOT COME ON\" in \"air bag restraint system.pdf\" of \"https://www.matthewsvolvosite.com/downloads/Volvo_850.zip\"].", NULL}, + {0x65, 127, "SRS Warning Light short circuit to ground or open circuit [see sections \"FAULT CODE 1-2-7\" and \"SRS WARNING LIGHT WILL NOT COME ON\" in \"air bag restraint system.pdf\" of \"https://www.matthewsvolvosite.com/downloads/Volvo_850.zip\"].", NULL}, + {0x66, 128, "SRS Warning Light short circuit to supply [see sections \"FAULT CODE 1-2-7\" and \"SRS WARNING LIGHT WILL NOT COME ON\" in \"air bag restraint system.pdf\" of \"https://www.matthewsvolvosite.com/downloads/Volvo_850.zip\"].", NULL}, + {0x67, 129, "Battery Voltage signal too low.", NULL}, + {0x68, 213, "Driver Airbag signal too low.", NULL}, + {0x69, 214, "Driver Airbag signal too high.", NULL}, + {0x6A, 233, "Left Seat Belt Tensioner signal too low.", NULL}, + {0x6B, 234, "Left Seat Belt Tensioner signal too high.", NULL}, + {0x6C, 243, "Right Seat Belt Tensioner signal too low.", NULL}, + {0x6D, 244, "Right Seat Belt Tensioner signal too high.", NULL}, + {0x6E, 223, "Passenger Airbag signal too low.", NULL}, + {0x6F, 224, "Passenger Airbag signal too high.", NULL}, + {0x70, 313, "Left Rear Seat Belt Tensioner signal too low.", NULL}, + {0x71, 314, "Left Rear Seat Belt Tensioner signal too high.", NULL}, + {0x72, 323, "Right Rear Seat Belt Tensioner signal too low.", NULL}, + {0x73, 324, "Right Rear Seat Belt Tensioner signal too high.", NULL}, + {0x78, 211, "Driver Airbag signal faulty.", NULL}, + {0x79, 212, "Driver Airbag signal missing.", NULL}, + {0x7A, 231, "Left Seat Belt Tensioner signal faulty.", NULL}, + {0x7B, 232, "Left Seat Belt Tensioner signal missing.", NULL}, + {0x7C, 241, "Right Seat Belt Tensioner signal faulty.", NULL}, + {0x7D, 242, "Right Seat Belt Tensioner signal missing.", NULL}, + {0x7E, 221, "Passenger Airbag signal faulty.", NULL}, + {0x7F, 222, "Passenger Airbag signal missing.", NULL}, + {0x80, 311, "Left Rear Seat Belt Tensioner signal faulty.", NULL}, + {0x81, 312, "Left Rear Seat Belt Tensioner signal missing.", NULL}, + {0x82, 321, "Right Rear Seat Belt Tensioner signal faulty.", NULL}, + {0x83, 322, "Right Rear Seat Belt Tensioner signal missing.", NULL}, + {0x88, 210, "Driver Airbag fault.", NULL}, + {0x89, 230, "Left Seat Belt Tensioner fault.", NULL}, + {0x8A, 240, "Right Seat Belt Tensioner fault.", NULL}, + {0x8B, 220, "Passenger Airbag fault.", NULL}, + {0x8C, 310, "Left Rear Seat Belt Tensioner fault.", NULL}, + {0x8D, 320, "Right Rear Seat Belt Tensioner fault.", NULL}, + {0xC7, 114, "Control Module faulty signal.", NULL}, + {0, 0, NULL, NULL}, +}; +static struct ecu_info ecu_list[] = { + { .addr = 0x01, .desc = "ABS", .dtc_prefix = "ABS" }, + { .addr = 0x11, .desc = "EFI", .dtc_prefix = "EFI" }, + { .addr = 0x29, .desc = "ECC", .dtc_prefix = "ECC" }, + { .addr = 0x41, .desc = "IMM", .dtc_prefix = "IMM" }, + { .addr = 0x51, .desc = "CI", .dtc_prefix = "CI" }, + { .addr = 0x58, .desc = "SRS", .dtc_prefix = "SRS" }, +}; +static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { + { + .ecu_addr = 0x01, + .dtc_table = dtc_list_01 + }, + { + .ecu_addr = 0x11, + .dtc_table = dtc_list_11 + }, + { + .ecu_addr = 0x29, + .dtc_table = dtc_list_29 + }, + { + .ecu_addr = 0x41, + .dtc_table = dtc_list_41 + }, + { + .ecu_addr = 0x51, + .dtc_table = dtc_list_51 + }, + { + .ecu_addr = 0x58, + .dtc_table = dtc_list_58 + }, + {0, NULL}, +}; + +#endif // __SCANTOOL_850_DTC_FROBBED_H__ diff --git a/scantool/scantool_850/parser.py b/scantool/scantool_850/parser.py index 1b9d6ff..80d2714 100644 --- a/scantool/scantool_850/parser.py +++ b/scantool/scantool_850/parser.py @@ -11,21 +11,30 @@ def __init__(self, ecu, code, prefix, suffix, description): self.prefix = prefix self.suffix = suffix +# a class representing an ecu address and description +class ecu: + # constructor + def __init__(self, address, description, prefix): + self.address = address + self.description = description + self.prefix = prefix + + # this loads dtcs from the xiaotec file export def load_dtcs(file_path): dtcs = [] + ecus = [] with open(file_path, 'r') as file: - ecu_addr = 0 - ecu_description = '' + current_ecu = None strings = {} for line in file: # regular expression to match 01 - description match = re.match(r'([0-9A-F][0-9A-F]) - (.+)', line.strip()) if match: - ecu_addr = match.groups()[0] - ecu_description = match.groups()[1] - # print(ecu_addr) + current_ecu = ecu(match.groups()[0], match.groups()[1], 'unknown') + ecus.append(current_ecu) + # print(current_ecu.address) # regular expression to match dtc.contains("") once match = re.match(r'^if \(dtc.contains\("([0-9A-F]+)"\)\) ?// ?([^\-]+)\-?([0-9]+) ?\(?([a-z])?\)?', line.strip()) @@ -33,7 +42,8 @@ def load_dtcs(file_path): string_key = match.groups()[2] if match.groups()[3]: string_key += match.groups()[3] - dtcs.append(dtc(ecu_addr, match.groups()[0], match.groups()[1], match.groups()[2].strip(), string_key)) + dtcs.append(dtc(current_ecu.address, match.groups()[0], match.groups()[1], match.groups()[2].strip(), string_key)) + current_ecu.prefix = match.groups()[1] # regular expression to match dtc.contains("") twice match = re.match(r'^if \(dtc.contains\("([0-9A-F]+)"\) ?\|\| ?dtc.contains\("([0-9A-F]+)"\)\) ?// ?([^\-]+)\-?([0-9]+) ?\(?([a-z])?\)?', line.strip()) @@ -41,14 +51,14 @@ def load_dtcs(file_path): string_key = match.groups()[2] if match.groups()[3]: string_key += match.groups()[3] - dtcs.append(dtc(ecu_addr, match.groups()[0], match.groups()[2], match.groups()[3], string_key)) - dtcs.append(dtc(ecu_addr, match.groups()[1], match.groups()[2], match.groups()[3], string_key)) + dtcs.append(dtc(current_ecu.address, match.groups()[0], match.groups()[2], match.groups()[3], string_key)) + dtcs.append(dtc(current_ecu.address, match.groups()[1], match.groups()[2], match.groups()[3], string_key)) match = re.match(r'(.+)', line.strip()) if match: - if not ecu_addr in strings: - strings[ecu_addr] = {} - strings[ecu_addr][match.groups()[0]] = match.groups()[1] + if not current_ecu.address in strings: + strings[current_ecu.address] = {} + strings[current_ecu.address][match.groups()[0]] = match.groups()[1] for d in dtcs: key = d.prefix + d.suffix @@ -72,22 +82,34 @@ def load_dtcs(file_path): d.description = escape(d.description) - return dtcs + return (dtcs, ecus) def escape(description): - return description.replace('"', '\\"') + result = description.replace('"', '\\"') + # Sadly some strings are already escaped :( so we need to unescape the double escape. + result = result.replace('\\\\"', '\\"') + # This is a weird typo in the original file :( + result = result.replace('\\A', '\\nA' + ) + return result # write a function to parse the DTCs from a text file and return a list of DTCs def parse_dtc_file(file_path): dtcs = [] + ecus = {} with open(file_path, 'r') as file: for line in file: match = re.match(r'([0-9]+) ([0-9A-F]+) ([A-Z]+)\-([0-9]+) (.+)', line.strip()) if match: # construct a dtc object from match and append it to the list dtcs.append(dtc(match.groups()[0], match.groups()[1], match.groups()[2], match.groups()[3], escape(match.groups()[4]))) - return dtcs + current_ecu = ecu(match.groups()[0], match.groups()[2], match.groups()[2]) + ecus[current_ecu.address] = current_ecu + ecu_list = [] + for key in ecus: + ecu_list.append(ecus[key]) + return (dtcs, ecu_list) # a function that takes a dtc object and a pointer to a mustach file and writes the dtc to the file def write_dtc_to_mustache(dtc, template): @@ -112,15 +134,22 @@ def group_dtcs_by_ecu(dtcs): # write a main function to call the parse_dtc_file function with a file from the first argument def main(): - if len(sys.argv) != 4: - print('Usage: python parser.py ') + if len(sys.argv) != 5: + print('Usage: python parser.py ') + sys.exit(1) + format = sys.argv[1] + if format == 'aleksi': + (raw_dtcs, ecus) = load_dtcs(sys.argv[2]) + elif format == 'richard': + (raw_dtcs, ecus) = parse_dtc_file(sys.argv[2]) + else: + print('Unknown format: ' + format) sys.exit(1) - # raw_dtcs = parse_dtc_file(sys.argv[1]) - raw_dtcs = load_dtcs(sys.argv[1]) + ecu_map = group_dtcs_by_ecu(raw_dtcs) - directory = sys.argv[2] - name = sys.argv[3] + directory = sys.argv[3] + name = sys.argv[4] with (open(directory + '/dtc.mustache', 'r') as dtc_template_file, open(directory + '/dtc_list.mustache', 'r') as dtc_list_template_file, @@ -150,9 +179,16 @@ def main(): out = out.replace('{{dtc_list_name}}', 'dtc_list_' + ecu.lower()) print(out) + print('static struct ecu_info ecu_list[] = {') + for ecu in ecus: + print(' { .addr = 0x' + ecu.address + ', .desc = "' + ecu.description + '", .dtc_prefix = "' + ecu.prefix + '" },') + print('};') + suffix_template = suffix_template_file.read() suffix_template = suffix_template.replace('{{name}}', name.upper()) suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(ecu_list)) print(suffix_template) +# Example call: python3 parser.py richard export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.h +# Example call: python3 parser.py aleksi DTC_List_850OBDII_D2.txt templates/ xiaotec > xiaotec.h main() \ No newline at end of file diff --git a/scantool/scantool_850/xiaotec.h b/scantool/scantool_850/xiaotec.h new file mode 100644 index 0000000..aa2924c --- /dev/null +++ b/scantool/scantool_850/xiaotec.h @@ -0,0 +1,742 @@ +#ifndef __SCANTOOL_850_DTC_XIAOTEC_H__ +#define __SCANTOOL_850_DTC_XIAOTEC_H__ + +#include +#include "../scantool_850/dtc.h" +#include "../scantool_850/ecu.h" + +static struct dtc_table_entry dtc_list_01[] = { + {0x05, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, + {0x30, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, + {0x10, 311, "ABS-311: Left Front Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, + {0x11, 321, "ABS-321: Left Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch]", NULL}, + {0x13, 211, "ABS-211: Left Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch]", NULL}, + {0x14, 221, "ABS-221: Left Front Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch]", NULL}, + {0x20, 312, "ABS-312: Right Front Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, + {0x21, 322, "ABS-322: Right Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch]", NULL}, + {0x23, 212, "ABS-212: Right Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch]", NULL}, + {0x24, 222, "ABS-222: Right Front Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch]", NULL}, + {0x31, 323, "ABS-323: Left Rear Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch]", NULL}, + {0x33, 213, "ABS-213: Left Rear Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch, or stuck emergency brake]", NULL}, + {0x34, 223, "ABS-223: Left Rear Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch]", NULL}, + {0x40, 314, "ABS-314: Right Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, + {0x41, 324, "ABS-324: Right Rear Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch]", NULL}, + {0x43, 214, "ABS-214: Right Rear Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch, or stuck emergency brake]", NULL}, + {0x44, 224, "ABS-224: Right Rear Wheel Sensor, ABS control phase too long (ie, signal absent in ABS function, yet circuit intact) [or bad ABS module solders or ignition switch]", NULL}, + {0x50, 411, "ABS-411: Left Front Wheel Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x51, 413, "ABS-413: Right Front Wheel Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x52, 421, "ABS-421: Rear Wheels Inlet Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x54, 412, "ABS-412: Left Front Wheel Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x55, 414, "ABS-414: Right Front Wheel Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x56, 422, "ABS-422: Rear Wheels Return Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x60, 423, "ABS-423: TRACS Valve, circuit open/short [ie, bad wiring, hydraulic modulator, ABS module, or ignition switch]", NULL}, + {0x61, 424, "ABS-424: TRACS Pressure Switch, circuit open/short [or bad wiring, hydraulic modulator, brake light switch, ABS module, ignition switch, or blown fuse 12 (STOP LAMPS)]??", NULL}, + {0x64, 141, "ABS-141: Brake Pedal Sensor, short [or bad ABS module solders, wiring, brake pedal sensor, or ignition switch]", NULL}, + {0x65, 142, "ABS-142: Brake Light/Pedal Switch, open/short or adjustment [or brake light bulb, bad ABS module solders, wiring, or ignition switch]", NULL}, + {0x67, 143, "ABS-143: Missing or Faulty Vehicle Speed Signal from ABS module [or bad ABS module solders, ABS module memory fault, or otherwise faulty ABS module or ignition switch]", NULL}, + {0x66, 144, "ABS-144: TRACS Disengaged to Avoid Front Brake Discs Overheating [or bad ABS module solders or ignition switch]", NULL}, + {0x70, 443, "ABS???443: Pump motor fault\n[or fuse 9 (ABS PUMP MOTOR), pump power plug not seated properly, bad wiring (eg, insulation that falls off, any short/open), bad ABS module solders, combination relay, hydraulic modulator, ignition switch]\n\nAdvanced command(s) ABS tests may not be able to be used if this code has been set.\n\nS40/V40 with Chassis number up to 414999 has defective power supply cable if ABS-441 and ABS-443 has been detected at the same time.\n Cable Harness -1997 P/N 30618007\nCable Harness 98-1999 P/N 30889999", NULL}, + {0x72, 431, "ABS-431: ABS Module, general hardware fault [or bad ABS module solders or ignition switch]", NULL}, + {0x75, 432, "ABS-432: ABS Module, general interference fault [or bad ABS module solders or ignition switch]", NULL}, + {0x77, 433, "ABS-433: Battery Voltage, too high", NULL}, + {0x80, 441, "ABS-441: ABS Microprocessors, redundant calculations mismatch\n[or fuse 14 (ABS MAIN SUPPLY), bad ABS module solders, wheel sensor wiring close to interference, ignition switch]\nS40/V40 with Chassis number up to 414999 has defective power supply cable if ABS 441 and ABS 443 has been detected at the same time.\n Cable Harness up to 1997 P/N 30618007\nCable Harness 98 to 1999 P/N 30889999", NULL}, + {0x81, 444, "ABS-444: ABS Module, internal valve reference voltage error or no power to hydraulic valves [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??", NULL}, + {0x82, 442, "ABS-442: ABS Module, leakage current or Hydraulic Modulator Pump Pressure, too low [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??", NULL}, + {0x83, 445, "ABS-445: ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_02[] = { + {0x01, 131, "DSA-131 Torque reduction signal, signal faulty", NULL}, + {0x02, 231, "DSA-231 Throttle position sensor signal, signal missing ", NULL}, + {0x03, 232, "DSA-232 Throttle position sensor signal, signal faulty", NULL}, + {0x04, 233, "DSA-233 DTC stored in engine control module", NULL}, + {0x05, 221, "DSA-221 Load signal missing (DSA control module registers no pulses from engine control module for approx. 1.5 seconds) Possibility: Open circuit, short circuit, contact resistance. DSA warning light and DSA is disengaged.", NULL}, + {0x06, 222, "DSA-222 Load signal, signal faulty", NULL}, + {0x07, 223, "DSA-223 Initiating engine control module, signal faulty", NULL}, + {0x08, 224, "DSA-224 DTC stored in engine control module", NULL}, + {0x09, 311, "DSA-311 Wheel speed signal left front wheel, signal faulty", NULL}, + {0x0A, 312, "DSA-312 Wheel speed signal right front wheel, signal faulty", NULL}, + {0x0B, 313, "DSA-313 Wheel speed signal left rear wheel, signal faulty", NULL}, + {0x0C, 314, "DSA-314 Wheel speed signal right rear wheel, signal faulty/missing from ABS control module.\nSignal is usually pulsed between 0V and battery voltage with freq. changes comparable to the wheel speed.\nFault code is registered at above speed 8km/h if the increase of speed of wheel is too great or too little or if other wheel is locked this can cause as well fault code. Notice code may be stored if power supply / ground terminal for ABS control module is defective.", NULL}, + {0x0D, 212, "DSA-212 Brake light switch, signal faulty.\nWhen Brake light switch is not activated the DSA/signal is grounded via brake light bulbs and when activated the switch (and bulbs) receive battery voltage. If ground is lost when engine is running or signal voltage is too low (compared to battery) when activated fault code is stored.", NULL}, + {0x0E, 211, "DSA-211 Brake light switch, signal too high", NULL}, + {0x0F, 121, "DSA-121 DSA switch, Signal too low", NULL}, + {0x10, 122, "DSA-122 DSA Warning lamp, signal faulty", NULL}, + {0x11, 112, "DSA-112 Control Module, EEPROM fault", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_11[] = { + {0x00, 131, "EFI-131: Engine Speed (RPM) signal", NULL}, + {0x01, 719, "EFI-719: Secondary Engine Speed signal", NULL}, + {0x02, 132, "EFI-132: Battery Voltage", NULL}, + {0x03, 711, "EFI-711: Needle Lift sensor signal", NULL}, + {0x04, 732, "EFI-732: Accelerator Pedal Position sensor signal", NULL}, + {0x05, 132, "EFI-132: Battery Voltage", NULL}, + {0x06, 122, "EFI-122: Intake Air Temp (IAT) sensor signal", NULL}, + {0x08, 712, "EFI-712: Fuel Temp sensor signal", NULL}, + {0x09, 415, "EFI-415: Boost Pressure sensor signal", NULL}, + {0x0A, 112, "EFI-112: (ECM) Barometric Pressure signal", NULL}, + {0x0B, 121, "EFI-121: Mass Air Flow (MAF) sensor signal", NULL}, + {0x0C, 743, "EFI-743: Cruise Control switch signal", NULL}, + {0x0D, 112, "EFI-112: (ECM) Barometric Pressure signal", NULL}, + {0x0F, 112, "EFI-112: (ECM) Barometric Pressure signal", NULL}, + {0x10, 311, "EFI-311: Speedometer Signal. Engine RPM vs. Vehicle Speed signal discrepancy", NULL}, + {0x11, 235, "EFI-235: EGR controller signal", NULL}, + {0x12, 242, "EFI-242: Turbocharger Control Valve (TCV) signal", NULL}, + {0x14, 515, "EFI-515: Engine Coolant Fan, high speed signal", NULL}, + {0x19, 713, "EFI-713: Injection Timing, Advance Control Valve signal", NULL}, + {0x1A, 323, "EFI-323: Check Engine light (CEL) / Malfunction indicator lamp (MIL) signal", NULL}, + {0x1B, 721, "EFI-721: Glowplug Indicator Lamp signal", NULL}, + {0x20, 714, "EFI-714: Fuel Shut-off Valve signal", NULL}, + {0x21, 730, "EFI-730: Brake Pedal Switch signal", NULL}, + {0x22, 731, "EFI-731: Clutch Switch signal", NULL}, + {0x23, 724, "EFI-724: Engine Coolant Heater Relay signal", NULL}, + {0x24, 112, "EFI-112: (ECM) Barometric Pressure signal", NULL}, + {0x26, 514, "EFI-514: Engine Coolant Fan, low speed signal", NULL}, + {0x2A, 725, "EFI-725: Main Relay signal", NULL}, + {0x2B, 715, "EFI-715: Fuel Regulation [EVRY mod?]", NULL}, + {0x2D, 726, "EFI-726: Terminal 15-supply to Engine Control Module (ECM)", NULL}, + {0x2E, 716, "EFI-716: Fuel Quantity Actuator signal [EVRY mod? /change fuel filter]", NULL}, + {0x2F, 718, "EFI-718: Ignition Timing Control", NULL}, + {0x30, 335, "EFI-335: Request for MIL lighting from TCM [or possibly Comm Failure between MSA 15.7 ECM and AW 50 42 TCM]", NULL}, + {0x31, 353, "EFI-353: Comm Failure with Immobilizer", NULL}, + {0x32, 742, "EFI-742: Comm Failure between MSA 15.7 ECM and AW 50 42 TCM [or possibly Request for MIL lighting from TCM]", NULL}, + {0x33, 225, "EFI-225: A/C Pressure sensor signal", NULL}, + {0x34, 717, "EFI-717: Fuel Quantity Regulator Position sensor signal [EVRY mod?]", NULL}, + {0x36, 732, "EFI-732: Accelerator Pedal Position sensor signal", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_18[] = { + {0x31, 801, "HEA-801: Coolant Temperature Sensor, Signal too High", NULL}, + {0x32, 802, "HEA-802: Coolant Temperature Sensor, Signal too Low", NULL}, + {0x33, 803, "HEA-803: Coolant Temperature Sensor, Signal faulty", NULL}, + {0x34, 142, "HEA-142: Outside Temperature Sensor, Signal too High", NULL}, + {0x35, 143, "HEA-143: Outside Temperature Sensor, Signal too Low", NULL}, + {0x36, 811, "HEA-811: Flame Sensor, Signal too Low during run", NULL}, + {0x37, 899, "HEA-899: Factory set DTC, no fault with heater", NULL}, + {0x38, 812, "HEA-812: Flame Sensor, Signal too High during start", NULL}, + {0x39, 813, "HEA-813: Flame Sensor, Signal too High", NULL}, + {0x3A, 821, "HEA-821: Water Pump, Signal too High", NULL}, + {0x3B, 822, "HEA-822: Water Pump, Signal too Low", NULL}, + {0x3C, 814, "HEA-814: Combustion fan, Signal too High", NULL}, + {0x3D, 815, "HEA-815: Combustion fan, Signal too Low", NULL}, + {0x3E, 816, "HEA-816: Combustion fan, Faulty Signal", NULL}, + {0x3F, 825, "HEA-825: Fuel Pump (FP), Signal too High", NULL}, + {0x40, 826, "HEA-826: Fuel Pump (FP), Signal too Low", NULL}, + {0x41, 831, "HEA-831: Overheat Protection Thermostat, Signal too Low", NULL}, + {0x42, 841, "HEA-841: Power Supply, Short Circuit to Supply", NULL}, + {0x43, 842, "HEA-842: Power Supply, Open Circuit", NULL}, + {0x44, 851, "HEA-851: Blower Fan, Signal too High", NULL}, + {0x45, 852, "HEA-852: Blower Fan, Signal too Low", NULL}, + {0x46, 861, "HEA-861: Glow Plugs, Short or Open Circuit", NULL}, + {0x47, 843, "HEA-843: Control Module Power Supply, Signal too High", NULL}, + {0x48, 832, "HEA-832: Overheat Protection Thermostat, Faulty Signal", NULL}, + {0x49, 891, "HEA-891: Too many Unsuccessful Start Attempts", NULL}, + {0x4A, 113, "HEA-113: Control Module, Parameter Fault", NULL}, + {0x4B, 112, "HEA-112: Control Module, General Fault", NULL}, + {0x51, 898, "HEA-898: Factory set DTC, no fault with heater", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_29[] = { + {0x0A, 221, "ECC-221: Air distribution damper motor position sensor Signal Low", NULL}, + {0x0B, 222, "ECC-222: Air distribution damper motor position sensor Signal High", NULL}, + {0x13, 322, "ECC-322: Air distribution damper motor position, no position change", NULL}, + {0x1A, 432, "ECC-432: Blower Fan Switch, Signal too Low", NULL}, + {0x1B, 433, "ECC-433: Blower Fan Motor, Current too High", NULL}, + {0x1C, 411, "ECC-411: Blower fan motor power unit, Faulty Signal / seized or drawing excess current [or blower fan obstruction, or power stage surge protector problem]", NULL}, + {0x1F, 412, "ECC-412: (inlet)Fan motor passenger comp (interior) temp sensor, Signal too Low / Short to Ground", NULL}, + {0x20, 121, "ECC-121: Outside Temperature Sensor, Signal too Low", NULL}, + {0x21, 122, "ECC-122: Outside Temperature Sensor, Signal too High", NULL}, + {0x22, 123, "ECC-123: Passenger compartment temperature sensor, Signal too Low", NULL}, + {0x23, 124, "ECC-124: Passenger compartment temperature sensor, Signal too High", NULL}, + {0x24, 135, "ECC-135: Engine Coolant Temperature (ECT) Signal Missing", NULL}, + {0x25, 211, "ECC-211: Drivers side Temp damper motor position sensor Signal High", NULL}, + {0x26, 212, "ECC-212: Drivers side Temp damper motor position sensor Signal Low", NULL}, + {0x27, 231, "ECC-231: Passenger Side Temp damper motor position sensor Signal High", NULL}, + {0x28, 232, "ECC-232: Passenger Side Temp damper motor position sensor Signal Low", NULL}, + {0x29, 235, "ECC-235: Recirculation damper motor position sensor Signal High", NULL}, + {0x2A, 236, "ECC-236: Recirculation damper motor position sensor Signal Low", NULL}, + {0x2B, 311, "ECC-311: Drivers side Temp damper motor, OC os SC in pot circuit", NULL}, + {0x2C, 313, "ECC-313: Passenger side Temp damper motor, OC os SC in pot circuit", NULL}, + {0x2D, 317, "ECC-317: Air distribution damper motor, OC or SC in pot circuit", NULL}, + {0x2E, 315, "ECC-315: Recirculation damper motor, OC or SC in pot circuit", NULL}, + {0x2F, 312, "ECC-312: Drivers side temp damper motor, no position change", NULL}, + {0x30, 314, "ECC-314: Passenger side temp damper motor, no position change", NULL}, + {0x31, 316, "ECC-316: Recirculation damper motor, no position change", NULL}, + {0x32, 143, "ECC-143: Passenger compartment temp selector Right, Signal Faulty", NULL}, + {0x33, 141, "ECC-143: Passenger compartment temp selector Left, Signal Faulty", NULL}, + {0x34, 431, "ECC-431: Blower Fan Switch, Signal too High", NULL}, + {0x35, 412, "ECC-412: (inlet)Fan motor passenger comp (interior) temp sensor, Signal too Low / Short to Ground", NULL}, + {0x36, 413, "ECC-413: (inlet)Fan motor passenger comp (interior) temp sensor, Signal too High", NULL}, + {0x37, 414, "ECC-414: (inlet)Fan motor passenger comp (interior) temp sensor, Faulty Signal", NULL}, + {0x38, 411, "ECC-411: Blower fan motor power unit, Faulty Signal / seized or drawing excess current [or blower fan obstruction, or power stage surge protector problem]", NULL}, + {0x3A, 420, "ECC-420: ECC Control Module, internal fault in memory circuits", NULL}, + {0x3B, 421, "ECC-421: ECC Control Module, internal fault in memory ROM circuits", NULL}, + {0x3C, 422, "ECC-422: Self-adjustment damper motors, Drivers temp failed", NULL}, + {0x3D, 423, "ECC-423: Self-adjustment damper motors, Passenger temp failed", NULL}, + {0x3E, 424, "ECC-424: Self-adjustment damper motors, Air distribution failed", NULL}, + {0x3F, 425, "ECC-425: Self-adjustment damper motors, Recirculation failed", NULL}, + {0x50, 441, "ECC-441: Program downloading, control module. Not Done", NULL}, + {0x51, 442, "ECC-442: Program downloading, control module. Faulty", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_2d[] = { + {0x41, 114, "GLA-114: Control Module, Fault in EEPROM", NULL}, + {0x42, 512, "GLA-512: Drivers Door Lock Switch, Unlocking Signal too Low / Short to Ground", NULL}, + {0x43, 521, "GLA-521: Drivers Central Locking Switch, Signal too Low / Short to Ground", NULL}, + {0x49, 511, "GLA-511: Drivers Door Lock Switch, Locking Signal too Low / Short to Ground", NULL}, + {0x4A, 311, "GLA-311: Siren, Faulty Signal", NULL}, + {0x4C, 312, "GLA-312: Siren, Internal Battery Fault", NULL}, + {0x4D, 321, "GLA-321: Siren, Fault In the Power Supply", NULL}, + {0x4F, 415, "GLA-415: Left ultrasonic sensor, Signal Faulty", NULL}, + {0x51, 416, "GLA-416: Left ultrasonic sensor, internal Fault", NULL}, + {0x52, 531, "GLA-531: Courtesy Lightning, Signal too Low / Short to Ground", NULL}, + {0x54, 421, "GLA-421: Glass breakage Sensor, Signal Faulty, to control module", NULL}, + {0x55, 422, "GLA-422: Glass breakage Sensor, Signal Faulty, microphone circuit", NULL}, + {0x56, 451, "GLA-451: Movement Sensor, Faulty Signal", NULL}, + {0x57, 413, "GLA-413: Right ultrasonic sensor, Signal Faulty", NULL}, + {0x58, 414, "GLA-414: Right ultrasonic sensor, internal Fault", NULL}, + {0x59, 432, "GLA-432: Tilt sensor, Internal fault", NULL}, + {0x60, 456, "GLA-456: SRS signal, Signal too Low / Short to Ground", NULL}, + {0x61, 452, "GLA-452: Airing module, Signal too High", NULL}, + {0x62, 610, "GLA-610: Speed Signal Faulty", NULL}, + {0x63, 441, "GLA-441: Resistive wire, Signal too High", NULL}, + {0x64, 541, "GLA-541: Ignition Switch, Signal too Low", NULL}, + {0x65, 431, "GLA-431: Tilt sensor, Signal too Low", NULL}, + {0x66, 454, "GLA-454: Immobilizer, Signal too Low", NULL}, + {0x67, 525, "GLA-525: Central Locking switch Passenger Door, Signal too Low", NULL}, + {0x69, 522, "GLA-522: Internal Tailgate/Trunk Control Switch, Signal too Low", NULL}, + {0x6A, 523, "GLA-523: External Tailgate/Trunk Lock Switch, Signal too Low", NULL}, + {0x6C, 524, "GLA-524: Fuel Filler Lock Switch, Signal too Low", NULL}, + {0x6D, 113, "GLA-113: Control Module, Control Module Not Programmed", NULL}, + {0x6E, 455, "GLA-455: Immobilizer, VGLA code Signal Faulty", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_2e[] = { + {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, + {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, + {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, + {0x04, 211, "PS-211: Seat Front Edge Motor 4, Pot signal too high", NULL}, + {0x05, 212, "PS-212: Legroom Motor 1, Pot signal too low", NULL}, + {0x06, 222, "PS-222: Backrest Motor 2, Pot signal too low", NULL}, + {0x07, 223, "PS-223: Seat Rear Edge Motor 3, Pot signal too low", NULL}, + {0x08, 312, "PS-312: Seat Front Edge Motor 4, Pot signal too low", NULL}, + {0x09, 123, "PS-123: Legroom Motor 1 Movement when not permitted", NULL}, + {0x0A, 131, "PS-131: Backrest Motor 2 Movement when not permitted", NULL}, + {0x0B, 132, "PS-132: Seat Rear Edge Motor 3 Movement when not permitted", NULL}, + {0x0C, 133, "PS-133: Seat Front Edge Motor 4 Movement when not permitted", NULL}, + {0x0D, 143, "PS-143: Legroom Motor 1 moves in wrong direction", NULL}, + {0x0E, 144, "PS-144: Backrest Motor 2 moves in wrong direction", NULL}, + {0x0F, 214, "PS-214: Seat Rear Edge Motor 3 moves in wrong direction", NULL}, + {0x10, 224, "PS-224: Seat Front Edge Motor 4 moves in wrong direction", NULL}, + {0x11, 323, "PS-323: Memory 1, Fault in stored memory position (try learn new position)", NULL}, + {0x12, 322, "PS-322: Memory 2, Fault in stored memory position (try learn new position)", NULL}, + {0x13, 321, "PS-321: Memory 3, Fault in stored memory position (try learn new position)", NULL}, + {0x14, 424, "PS-424: Control Panel not connected", NULL}, + {0x15, 421, "PS-421: Fault in control module", NULL}, + {0x16, 422, "PS-422: Battery Voltage too low", NULL}, + {0x17, 423, "PS-423: Control Panel button activated too long", NULL}, + {0x18, 411, "PS-411: Legroom Motor 1 not calibrated", NULL}, + {0x19, 412, "PS-412: Backrest Motor 2 not calibrated", NULL}, + {0x1A, 413, "PS-413: Seat Rear Edge Motor 3 not calibrated", NULL}, + {0x1B, 414, "PS-414: Seat Front Edge Motor 4 not calibrated", NULL}, + {0x1C, 331, "PS-331: Entry position not stored", NULL}, + {0x1D, 332, "PS-332: Original position not stored", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_2f[] = { + {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, + {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, + {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, + {0x04, 211, "PS-211: Seat Front Edge Motor 4, Pot signal too high", NULL}, + {0x05, 212, "PS-212: Legroom Motor 1, Pot signal too low", NULL}, + {0x06, 222, "PS-222: Backrest Motor 2, Pot signal too low", NULL}, + {0x07, 223, "PS-223: Seat Rear Edge Motor 3, Pot signal too low", NULL}, + {0x08, 312, "PS-312: Seat Front Edge Motor 4, Pot signal too low", NULL}, + {0x09, 123, "PS-123: Legroom Motor 1 Movement when not permitted", NULL}, + {0x0A, 131, "PS-131: Backrest Motor 2 Movement when not permitted", NULL}, + {0x0B, 132, "PS-132: Seat Rear Edge Motor 3 Movement when not permitted", NULL}, + {0x0C, 133, "PS-133: Seat Front Edge Motor 4 Movement when not permitted", NULL}, + {0x0D, 143, "PS-143: Legroom Motor 1 moves in wrong direction", NULL}, + {0x0E, 144, "PS-144: Backrest Motor 2 moves in wrong direction", NULL}, + {0x0F, 214, "PS-214: Seat Rear Edge Motor 3 moves in wrong direction", NULL}, + {0x10, 224, "PS-224: Seat Front Edge Motor 4 moves in wrong direction", NULL}, + {0x11, 323, "PS-323: Memory 1, Fault in stored memory position (try learn new position)", NULL}, + {0x12, 322, "PS-322: Memory 2, Fault in stored memory position (try learn new position)", NULL}, + {0x13, 321, "PS-321: Memory 3, Fault in stored memory position (try learn new position)", NULL}, + {0x14, 424, "PS-424: Control Panel not connected", NULL}, + {0x15, 421, "PS-421: Fault in control module", NULL}, + {0x16, 422, "PS-422: Battery Voltage too low", NULL}, + {0x17, 423, "PS-423: Control Panel button activated too long", NULL}, + {0x18, 411, "PS-411: Legroom Motor 1 not calibrated", NULL}, + {0x19, 412, "PS-412: Backrest Motor 2 not calibrated", NULL}, + {0x1A, 413, "PS-413: Seat Rear Edge Motor 3 not calibrated", NULL}, + {0x1B, 414, "PS-414: Seat Front Edge Motor 4 not calibrated", NULL}, + {0x1C, 331, "PS-331: Entry position not stored", NULL}, + {0x1D, 332, "PS-332: Original position not stored", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_41[] = { + {0x01, 112, "IMM-112: Internal EEPROM memory fault", NULL}, + {0x02, 211, "IMM-211/213: Comm fault with engine ECU", NULL}, + {0x03, 212, "IMM-212/233: No Contact with Antenna.\nOr wrong antenna. Ex. Immo2 on 850 has 8??, Immo3 on S/V40 has 3.3??, V70 has 5?? as rough resistance measurement.\nAntenna is tuned inside IMMO with capacitors and resistors for antennas inductivity to create LC circuit.\nOther reasons:\nThe cable between control module Pin #9 or #10 is short to gnd or +12V.", NULL}, + {0x04, 221, "IMM-221/234: No Response from Key Transponder", NULL}, + {0x05, 222, "IMM-222/235: Key Code not in memory", NULL}, + {0x06, 223, "IMM-223: Comm fault from Transponder to IMMO Control Module", NULL}, + {0x07, 336, "IMM-336: Control circuit to VGLA, fault in VGLA or LED circuit", NULL}, + {0x30, 334, "IMM-334 Control circuit to Indicator Lamp, fault in circuit", NULL}, + {0x31, 335, "IMM-335: Starter Motor Control circuit, fault in circuit", NULL}, + {0x32, 324, "IMM-324: VERLOG code missing (ECM or CSM module coding) or mismatch.", NULL}, + {0x33, 325, "IMM-325: Faulty Comms with coded starter module (CSM)", NULL}, + {0x34, 121, "IMM-121: PIN cannot be programmer / programming failed", NULL}, + {0x35, 225, "IMM-225: Fault Programming Key Code / Key Code verification failed", NULL}, + {0x36, 132, "IMM-132: No Key Codes in EEPROM. Live data should say IMMO PROG as not NORM.", NULL}, + {0x37, 122, "IMM-122: Immobilizer not yet programmed / Not yet initiated. After entering the code this gets automatically erased.", NULL}, + {0x38, 999, "IMM-999: EEPROM error", NULL}, + {0x51, 311, "IMM-311: Comms with engine ECU, short to supply in comm link 2 or 4", NULL}, + {0x52, 312, "IMM-312: Comms with engine ECU, short to ground in comm link 2 or 4", NULL}, + {0x53, 214, "IMM-214: Comms from engine ECU, wrong MIN code (ie, Immobilizer is programmed for a different engine ECU)", NULL}, + {0x54, 321, "IMM-321: Initiating signal from ECM, missing", NULL}, + {0x55, 326, "IMM-326: Reply signal from engine control module", NULL}, + {0xF7, 333, "IMM-333: Control circuit to VGLA, fault in VGLA or LED circuit", NULL}, + {0xF8, 336, "IMM-336: Control circuit to VGLA, fault in VGLA or LED circuit", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_51[] = { + {0x01, 222, "CI-222: Vehicle Speed signal too high", NULL}, + {0x02, 221, "CI-221: Vehicle speed signal missing [bad ABS module solders?]", NULL}, + {0x03, 114, "CI-114: Fuel Level sensor stuck", NULL}, + {0x04, 112, "CI-112: Fuel Level signal too low / short to ground", NULL}, + {0x05, 113, "CI-113: Fuel Level signal too High / Low Fuel / short to supply", NULL}, + {0x06, 121, "CI-121: Engine Coolant Temperature signal faulty", NULL}, + {0x07, 123, "CI-123: 48-pulse output Speed Signal too high / short to supply", NULL}, + {0x08, 143, "CI-143: 48-pulse output Speed Signal too low / short to ground", NULL}, + {0x09, 131, "CI-131: 12-pulse Speed Signal too high / short to supply", NULL}, + {0x0A, 141, "CI-141: 12-pulse Speed Signal too low / short to ground", NULL}, + {0x0B, 132, "CI-132: Engine RPM signal missing", NULL}, + {0x0C, 124, "CI-124: Engine RPM signal faulty", NULL}, + {0x0D, 211, "CI-211: D+ alternator voltage signal too low / missing for >= 10 sec when > 1000 RPM", NULL}, + {0x0E, 133, "CI-133: Fuel Level Signal To Trip Computer too high / short to supply", NULL}, + {0x0F, 142, "CI-142: Ambient Temperature signal missing [Grey connector sensor at the bumper on 850]", NULL}, + {0x10, 231, "CI-231: COMBI microprocessor internal fault", NULL}, + {0x11, 174, "CI-174: Fuel Consumption signal missing / or Wide Disparity in Fuel Levels", NULL}, + {0x20, 232, "CI-232: COMBI is not yet programmed", NULL}, + {0xF8, 231, "CI-231: COMBI microprocessor internal fault", NULL}, + {0xF9, 113, "CI-113: Fuel Level signal too High / Low Fuel / short to supply", NULL}, + {0xFA, 112, "CI-112: Fuel Level signal too low / short to ground", NULL}, + {0xFB, 115, "CI-115: Fuel Level Sensor Circuit Malfunction", NULL}, + {0xFC, 415, "CI-415: Road Speed Signal missing or faulty", NULL}, + {0xFD, 414, "CI-414: Road Speed Signal missing or faulty", NULL}, + {0x01, 112, "SRS-112: Crash Sensor Module internal fault", NULL}, + {0xC7, 114, "SRS-114: Control Module faulty signal", NULL}, + {0x52, 127, "SRS-127: SRS Warning Light short circuit to ground or open circuit", NULL}, + {0x65, 127, "SRS-127: SRS Warning Light short circuit to ground or open circuit", NULL}, + {0x53, 128, "SRS-128: SRS Warning Light short circuit to supply", NULL}, + {0x66, 128, "SRS-128: SRS Warning Light short circuit to supply", NULL}, + {0x67, 129, "SRS-129: Battery Voltage signal too low", NULL}, + {0x88, 210, "SRS-210: Driver Airbag fault", NULL}, + {0x78, 211, "SRS-211: Driver Airbag signal faulty (in contact reel and/or in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x02, 211, "SRS-211: Driver Airbag signal faulty (in contact reel and/or in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x79, 212, "SRS-212: Drivers airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x03, 212, "SRS-212: Drivers airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x68, 213, "SRS-213 - Drivers airbag short circuit to ground", NULL}, + {0x04, 213, "SRS-213 - Drivers airbag short circuit to ground", NULL}, + {0x69, 214, "SRS-214: Driver Airbag short circuit to supply (in contact reel, airbag, wiring harness, or connectors)", NULL}, + {0x05, 214, "SRS-214: Driver Airbag short circuit to supply (in contact reel, airbag, wiring harness, or connectors)", NULL}, + {0x8B, 220, "SRS-220: Passenger Airbag fault", NULL}, + {0x06, 221, "SRS-221: Passenger Airbag short circuit (in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x7E, 221, "SRS-221: Passenger Airbag short circuit (in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x07, 222, "SRS-222: Passenger Airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x7F, 222, "SRS-222: Passenger Airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x08, 223, "SRS-223: Passenger Airbag short circuit to ground (in airbag, wiring harness, or connectors)", NULL}, + {0x6E, 223, "SRS-223: Passenger Airbag short circuit to ground (in airbag, wiring harness, or connectors)", NULL}, + {0x09, 224, "SRS-224: Passenger Airbag short circuit to supply (in airbag, wiring harness, or connectors)", NULL}, + {0x6F, 224, "SRS-224: Passenger Airbag short circuit to supply (in airbag, wiring harness, or connectors)", NULL}, + {0x89, 230, "SRS-230: Left Seat Belt Tensioner fault", NULL}, + {0x0A, 231, "SRS-231: Left Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x7A, 231, "SRS-231: Left Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x0B, 232, "SRS-232: Left Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x7B, 232, "SRS-232: Left Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x0C, 233, "SRS-233: Left Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x6A, 233, "SRS-233: Left Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x0D, 234, "SRS-234: Left Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x6B, 234, "SRS-234: Left Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x8A, 240, "SRS-240: Right Seat Belt Tensioner fault", NULL}, + {0x0E, 241, "SRS-241: Right Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x7C, 241, "SRS-241: Right Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x0F, 242, "SRS-242: Right Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x7D, 242, "SRS-242: Right Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x10, 243, "SRS-243: Right Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x6C, 243, "SRS-243: Right Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x11, 244, "SRS-244: Right Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x6D, 244, "SRS-244: Right Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x8C, 310, "SRS-310: Left Rear Seat Belt Tensioner fault", NULL}, + {0x80, 311, "SRS-311: Left Rear Seat Belt Tensioner signal faulty", NULL}, + {0x81, 312, "SRS-312: Left Rear Seat Belt Tensioner signal missing", NULL}, + {0x70, 313, "SRS-313: Left Rear Seat Belt Tensioner signal too low", NULL}, + {0x71, 314, "SRS-314: Left Rear Seat Belt Tensioner signal too high", NULL}, + {0x8D, 320, "SRS-320: Right Rear Seat Belt Tensioner fault", NULL}, + {0x82, 321, "SRS-321: Right Rear Seat Belt Tensioner signal faulty", NULL}, + {0x83, 322, "SRS-322: Right Rear Seat Belt Tensioner signal missing", NULL}, + {0x72, 323, "SRS-323: Right Rear Seat Belt Tensioner signal too low", NULL}, + {0x73, 324, "SRS-324: Right Rear Seat Belt Tensioner signal too high", NULL}, + {0x0001, 112, "SRS-112: Crash Sensor Module internal fault", NULL}, + {0x0065, 127, "SRS-127: SRS Warning Light short circuit to ground or open circuit", NULL}, + {0x0066, 128, "SRS-128: SRS Warning Light short circuit to supply", NULL}, + {0x0067, 129, "SRS-129: Battery Voltage signal too low", NULL}, + {0x0068, 213, "SRS-213 - Drivers airbag short circuit to ground", NULL}, + {0x0069, 214, "SRS-214: Driver Airbag short circuit to supply (in contact reel, airbag, wiring harness, or connectors)", NULL}, + {0x006A, 233, "SRS-233: Left Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x006B, 234, "SRS-234: Left Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x006C, 243, "SRS-243: Right Seat Belt Tensioner short circuit to ground (in tensioner, wiring harness, or connectors)", NULL}, + {0x006D, 244, "SRS-244: Right Seat Belt Tensioner short circuit to supply (in tensioner, wiring harness, or connectors)", NULL}, + {0x006E, 223, "SRS-223: Passenger Airbag short circuit to ground (in airbag, wiring harness, or connectors)", NULL}, + {0x006F, 224, "SRS-224: Passenger Airbag short circuit to supply (in airbag, wiring harness, or connectors)", NULL}, + {0x0070, 313, "SRS-313: Left Rear Seat Belt Tensioner signal too low", NULL}, + {0x0071, 314, "SRS-314: Left Rear Seat Belt Tensioner signal too high", NULL}, + {0x0072, 323, "SRS-323: Right Rear Seat Belt Tensioner signal too low", NULL}, + {0x0073, 324, "SRS-324: Right Rear Seat Belt Tensioner signal too high", NULL}, + {0x0074, 413, "SRS-413: SIPS-bag, left - Signal too low", NULL}, + {0x0075, 414, "SRS-414: SIPS-bag, left - Signal too high", NULL}, + {0x0076, 423, "SRS-423: SIPS-bag, right - Signal too low", NULL}, + {0x0077, 424, "SRS-424: SIPS-bag, right - Signal too high", NULL}, + {0x0078, 211, "SRS-211: Driver Airbag signal faulty (in contact reel and/or in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x0079, 212, "SRS-212: Drivers airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x007A, 231, "SRS-231: Left Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x007B, 232, "SRS-232: Left Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x007C, 241, "SRS-241: Right Seat Belt Tensioner short circuit (in SRS harness to tensioner, connectors, or igniter)", NULL}, + {0x007D, 242, "SRS-242: Right Seat Belt Tensioner open circuit (in SRS harness, connector, or tensioner)", NULL}, + {0x007E, 221, "SRS-221: Passenger Airbag short circuit (in SRS harness to airbag, connectors, or igniter)", NULL}, + {0x007F, 222, "SRS-222: Passenger Airbag open circuit (in SRS harness, connector, or airbag)", NULL}, + {0x0080, 311, "SRS-311: Left Rear Seat Belt Tensioner signal faulty", NULL}, + {0x0081, 312, "SRS-312: Left Rear Seat Belt Tensioner signal missing", NULL}, + {0x0082, 321, "SRS-321: Right Rear Seat Belt Tensioner signal faulty", NULL}, + {0x0083, 322, "SRS-322: Right Rear Seat Belt Tensioner signal missing", NULL}, + {0x0084, 411, "SRS-411: SIPS-bag, left - Faulty signal", NULL}, + {0x0085, 412, "SRS-412: SIPS-bag, left - Signal missing or faulty", NULL}, + {0x0086, 421, "SRS-421: SIPS-bag, right - Faulty signal", NULL}, + {0x0087, 422, "SRS-422: SIPS-bag, right - Signal missing or faulty", NULL}, + {0x0088, 210, "SRS-210: Driver Airbag fault", NULL}, + {0x0089, 230, "SRS-230: Left Seat Belt Tensioner fault", NULL}, + {0x008A, 240, "SRS-240: Right Seat Belt Tensioner fault", NULL}, + {0x008B, 220, "SRS-220: Passenger Airbag fault", NULL}, + {0x008C, 310, "SRS-310: Left Rear Seat Belt Tensioner fault", NULL}, + {0x008D, 320, "SRS-320: Right Rear Seat Belt Tensioner fault", NULL}, + {0x008E, 410, "SRS-410: SIPS-bag, left - Faulty signal", NULL}, + {0x008F, 420, "SRS-420: SIPS-bag, right - Faulty signal", NULL}, + {0x0090, 512, "SRS-512: Belt buckle (lock), driver - faulty signal", NULL}, + {0x0091, 513, "SRS-513: Belt buckle (lock), driver - faulty signal", NULL}, + {0x0092, 514, "SRS-514: Belt buckle (lock), driver - Signal too high", NULL}, + {0x0093, 522, "SRS-522: Belt buckle (lock), passenger - faulty signal", NULL}, + {0x0094, 523, "SRS-523: Belt buckle (lock), passenger - faulty signal", NULL}, + {0x0095, 524, "SRS-524: Belt buckle (lock), passenger - Signal too high", NULL}, + {0x0096, 510, "SRS-510: Belt buckle (lock), driver - faulty signal", NULL}, + {0x0097, 520, "SRS-520: Belt buckle (lock), passenger - faulty signal", NULL}, + {0x00A0, 605, "SRS-605: Side impact sensor, left - faulty signal", NULL}, + {0x00A1, 606, "SRS-606: Side impact sensor, left - signal missing", NULL}, + {0x00A2, 615, "SRS-615: Side impact sensor, right - faulty signal", NULL}, + {0x00A3, 616, "SRS-616: Side impact sensor, right - signal missing", NULL}, + {0x00A4, 610, "SRS-610: Side impact sensor, left - faulty signal", NULL}, + {0x00A5, 620, "SRS-620: Side impact sensor, right - faulty signal", NULL}, + {0x00B0, 731, "SRS-731: Switch, passenger airbag - faulty signal", NULL}, + {0x00B1, 732, "SRS-732: Switch, passenger airbag - signal missing or faulty", NULL}, + {0x00B2, 733, "SRS-733: Switch, passenger airbag - signal too low", NULL}, + {0x00B3, 730, "SRS-730: Switch, passenger airbag - system configuration", NULL}, + {0x00B9, 530, "SRS-530: Belt reminder - Signal too high", NULL}, + {0x00C5, 804, "SRS-804: Crash sensor - credibility test", NULL}, + {0x00C6, 800, "SRS-800: Hydraulic/mechanical fault - system configuration", NULL}, + {0x00C7, 114, "SRS-114: Control Module faulty signal", NULL}, + {0x01, 412, "ROP-412: Control Module, Internal Fault", NULL}, + {0x63, 413, "ROP-413: Transit Safety Catch On", NULL}, + {0x65, 427, "ROP-427: ROPS warning Lamp, Faulty Signal", NULL}, + {0x66, 428, "ROP-428: ROPS warning Lamp, Signal too High", NULL}, + {0x67, 429, "ROP-429: Battery Voltage Signal too Low", NULL}, + {0x68, 430, "ROP-430: Solenoids S1 , S2, faulty Signal crash bow", NULL}, + {0x69, 431, "ROP-431: Left Solenoid S1, Signal too Low", NULL}, + {0x6A, 432, "ROP-432: Left Solenoid S1, Signal Missing", NULL}, + {0x6B, 433, "ROP-433: Left Solenoid S1, Signal too High", NULL}, + {0x6D, 441, "ROP-441: Right Solenoid S2, Signal too Low", NULL}, + {0x6E, 442, "ROP-442: Right Solenoid S2, Signal Missing", NULL}, + {0x6F, 443, "ROP-443: Right Solenoid S2, Signal too High", NULL}, + {0x71, 451, "ROP-451: Solenoids S1 , S2, faulty counter Max No. of triggers Done", NULL}, + {0x78, 452, "ROP-452: Control Module, handling fault during Self Test", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_62[] = { + {0x10, 112, "RTI-112: Control Module, Internal Fault Memory circuits", NULL}, + {0x20, 113, "RTI-113: Control Module, Internal Fault, Internal comms", NULL}, + {0x30, 114, "RTI-114: Control Module, Internal Fault, Display screen comms", NULL}, + {0x40, 121, "RTI-121: CD-ROM player, temperature too high", NULL}, + {0x41, 122, "RTI-122: CD-ROM player, Internal Fault", NULL}, + {0x42, 123, "RTI-123: CD-ROM player, Fault in player circuits", NULL}, + {0x43, 125, "RTI-125: CD-ROM player, Fault in player circuits", NULL}, + {0x44, 124, "RTI-124: CD-ROM player, Fault in comms signal", NULL}, + {0x50, 115, "RTI-115: Control Module, Internal Fault, Internal Comms", NULL}, + {0x60, 131, "RTI-131: TMC receiver, faulty signal", NULL}, + {0x70, 141, "RTI-141: TMC/FM receiver, faulty signal", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_6e[] = { + {0x02, 122, "AT-122: Shift Solenoid S1 circuit, open [eg, bad wiring or solenoid, or low/dirty fluid]", NULL}, + {0x03, 121, "AT-121: Shift Solenoid S1 circuit, short to ground [eg, bad wiring, solenoid, or TCM (ie, ECU 6E), or low/dirty fluid]", NULL}, + {0x08, 222, "AT-222: Shift solenoid S2 circuit", NULL}, + {0x09, 221, "AT-221: Shift solenoid S2 circuit, SC to ground", NULL}, + {0x0D, 123, "AT-123: Line Pressure Solenoid STH circuit, short to supply [eg, bad wiring or TCM, or low/dirty fluid]", NULL}, + {0x0E, 132, "AT-132: TCM Fault, amplifier STH short circuit (eg, poor terminal contact at TCM connector, open circuit in TCM voltage supply or grounds, bad TCM, or low/dirty fluid]", NULL}, + {0x0F, 131, "AT-131: Line Pressure Solenoid STH circuit, open or short to ground [eg, bad wiring, poor terminal contact, bad TCM, or low/dirty fluid]", NULL}, + {0x12, 331, "AT-331: Lock-up sol SL, SC circuit to supply", NULL}, + {0x13, 332, "AT-332: Lock-up sol SL circuit, open circuit", NULL}, + {0x14, 333, "AT-333: Lock-up sol SL circuit, SC to ground", NULL}, + {0x17, 213, "AT-213: Throttle Position Sensor (TPS) signal, signal too high", NULL}, + {0x18, 223, "AT-223: Throttle Position Sensor (TPS) signal, signal too low [or unplugged - no signal] [P0120] \nAfter repairs must they be verified by:\n\n-Ignition on\n-Push down the accelerator pedal to wide open throttle (WOT) and keep it fully depressed.\n-Wait 15 seconds.\n Read off the status DTC.\n\n\nIf the fault is intermittent the indicator and warning lamp will go out after the ignition has been switched on and off a certain number of times. Up to five times.\n\n\n TMC may ask ECM to turn on MIL light.", NULL}, + {0x1C, 143, "AT-143: Kickdown switch circuit, signal too low", NULL}, + {0x1F, 232, "AT-232: Vehicle Speed signal absent", NULL}, + {0x23, 311, "AT-311: Transmission RPM signal absent", NULL}, + {0x28, 321, "AT-321: Gear 1, incorrect ratio", NULL}, + {0x29, 322, "AT-322: Gear 2, incorrect ratio", NULL}, + {0x2A, 323, "AT-323: Gear 3, incorrect ratio", NULL}, + {0x2B, 324, "AT-324: Gear 4, incorrect ratio", NULL}, + {0x2F, 341, "AT-341: Lock-up function, slipping or not engaged", NULL}, + {0x35, 114, "AT-114: Mode Selector Switch, Signal too High [ie, short circuit to supply, driving mode selector module, or cluster fault feeding transmission fault light]", NULL}, + {0x36, 124, "AT-124: Mode Selector Switch, Signal too Low. Short circuit to ground [eg, \"W\" button depressed > 25 sec, controls sticking, loose parts, bad resistance, bad wiring]", NULL}, + {0x39, 313, "AT-313: Gear position sensor faulty signal", NULL}, + {0x3C, 134, "AT-134: engine load signal incorrect", NULL}, + {0x3F, 245, "AT-245: torque limiting signal absent", NULL}, + {0x42, 235, "AT-235: Oil Temperature", NULL}, + {0x43, 141, "AT-141: Oil Temp Sensor", NULL}, + {0x44, 142, "AT-142: Oil Temp Sensor", NULL}, + {0x46, 243, "AT-243: Torque Reduction Signal too Low", NULL}, + {0x47, 244, "AT-244: Torque Reduction Signal too High", NULL}, + {0x48, 521, "AT-521: Control Module Communication", NULL}, + {0x49, 412, "AT-412: Control Module EEPROM fault", NULL}, + {0x50, 411, "AT-411: Control Module EEPROM fault", NULL}, + {0x51, 421, "AT-421: Battery Volts too low", NULL}, + {0x55, 511, "AT-511: Control Module Communication", NULL}, + {0x60, 522, "AT-522: Control Module Communication", NULL}, + {0x61, 523, "AT-523: Control Module Communication", NULL}, + {0x62, 524, "AT-524: Control Module Communication", NULL}, + {0x63, 525, "AT-525: Control Module Communication", NULL}, + {0x64, 526, "AT-526: Control Module Communication", NULL}, + {0xE0, 527, "AT-527: Control Module Communication", NULL}, + {0, 0, NULL, NULL}, +}; +static struct dtc_table_entry dtc_list_7a[] = { + {0x0A, 422, "EFI-422: Atmospheric pressure sensor signal", NULL}, + {0x0F, 122, "EFI-122: Intake Air Temperature (IAT) Sensor Faulty", NULL}, + {0x12, 414, "EFI-414: Boost pressure regulation", NULL}, + {0x13, 121, "EFI-121: Mass Air Flow (MAF) sensor signal", NULL}, + {0x15, 123, "EFI-123: Engine Coolant Temperature (ECT) sensor [P0116 (faulty), P0117 (low), or P0118 (high)] [see \"http://www.volvopedia.de/index.php?title=EFI-123#Motronic_4.4\"]", NULL}, + {0x16, 212, "EFI-212: HO2S sensor signal, front", NULL}, + {0x17, 435, "EFI-435: Front HO2S slow response", NULL}, + {0x18, 521, "EFI-521: Front HO2S, preheating", NULL}, + {0x1A, 153, "EFI-153: HO2S sensor signal, rear [P0136 (faulty), P0137 (low), or P0138 (high)]", NULL}, + {0x1C, 522, "EFI-522: Rear HO2S preheating malfunction [P0141]", NULL}, + {0x1E, 115, "EFI-115: Injector 1", NULL}, + {0x1F, 125, "EFI-125: Injector 2", NULL}, + {0x20, 135, "EFI-135: Injector 3", NULL}, + {0x21, 145, "EFI-145: Injector 4", NULL}, + {0x24, 222, "EFI-222: System Relay Control, Signal Faulty", NULL}, + {0x25, 512, "EFI-512: Short-term Fuel Trim, changes too quickly", NULL}, + {0x26, 232, "EFI-232: Long term fuel trim, idling [P0172] [elbow at intake manifold (hidden underneath coolant thermostat), elbow at PTC, vacuum leaks", NULL}, + {0x27, 231, "EFI-231: Long term fuel trim, part load", NULL}, + {0x29, 153, "EFI-153: HO2S sensor signal, rear [P0136 (faulty), P0137 (low), or P0138 (high)]", NULL}, + {0x2A, 436, "EFI-436: Rear HO2S compensation [P0133]", NULL}, + {0x2B, 521, "EFI-521: Front HO2S, preheating", NULL}, + {0x2C, 522, "EFI-522: Rear HO2S preheating malfunction [P0141]", NULL}, + {0x2D, 242, "EFI-242: Turbocharger (TC) Control Valve, Signal Faulty", NULL}, + {0x32, 314, "EFI-314: Camshaft Position sensor (CMP) signal [next to distributor, cannot verify ohm readings as its all over place from 2k to millions of ohms. When cranking you should get 1.5 to 2hz reading. Dont unplug sensor needs power to work.]", NULL}, + {0x38, 525, "EFI-525: Ignition Coil 1 circuit Faulty", NULL}, + {0x3A, 526, "EFI-526: Ignition Coil 2 circuit Faulty", NULL}, + {0x41, 143, "EFI-143: Front knock sensor (KS)", NULL}, + {0x46, 543, "EFI-543: Misfire exhaust value of at least one cylinder", NULL}, + {0x4D, 545, "EFI-545: Misfire, at least 1 cylinder", NULL}, + {0x53, 214, "EFI-214: RPM sensor signal sporadic faulty [on gearbox casing, also known as Crankshaft sensor, should get reading of 200 to 400 Ohms with multimeter. Two pole connector.]", NULL}, + {0x5A, 443, "EFI-443: TWC (catalysator) efficiency", NULL}, + {0x6B, 225, "EFI-225: A/C pressure sensor signal", NULL}, + {0x6F, 311, "EFI-311: Engine RPM high for too long while no Vehicle Speed [see www.volvopedia.de/index.php?title=EFI-311]", NULL}, + {0x70, 412, "EFI-412: Throttle Position (TP) signal to DSA faulty", NULL}, + {0x73, 411, "EFI-411: Throttle Position (TP) sensor signal", NULL}, + {0x76, 666, "EFI-666: DTC in transmission CM", NULL}, + {0x78, 131, "EFI-131: RPM sensor signal missing [on gearbox casing, also known as Crankshaft sensor, should get reading of 200 to 400 Ohms with multimeter. Two pole connector.]", NULL}, + {0x7D, 342, "EFI-342: Air Conditioning (A/C) Relay, Signal faulty", NULL}, + {0x7F, 323, "EFI-323: Malfunction indicator lamp (MIL) circuit fault", NULL}, + {0x82, 516, "EFI-516: Air Conditioning (A/C) cooling fan (FC) circuit fault", NULL}, + {0x85, 514, "EFI-514: Engine coolant fan, low speed", NULL}, + {0x87, 515, "EFI-515: Engine cooling fan (FC) High-speed, Signal", NULL}, + {0x8A, 226, "EFI-226: Idle Air Control (IAC) Valve, Signal Faulty", NULL}, + {0x8C, 233, "EFI-233: Adaptive idle air trim", NULL}, + {0x91, 337, "EFI-337: Torque Limiting Signal from DSA faulty", NULL}, + {0xA3, 254, "EFI-254: System Relay Output, circuit faulty", NULL}, + {0xE0, 743, "EFI-742: CAN Bus off, No Comms", NULL}, + {0xFE, 337, "EFI-337: Torque Limiting Signal from DSA faulty", NULL}, + {0x65, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0x67, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0x7A, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0xED, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0x7F, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0xDE, 112, "EFI-112: MFI Control Module (CM) fault", NULL}, + {0x96, 115, "EFI-115: Injector 1", NULL}, + {0x73, 121, "EFI-121: Mass Air Flow (MAF) sensor signal", NULL}, + {0x7B, 123, "EFI-123: Engine Coolant Temperature (ECT) sensor [P0116 (faulty), P0117 (low), or P0118 (high)] [see \"http://www.volvopedia.de/index.php?title=EFI-123#Motronic_4.4\"]", NULL}, + {0x97, 125, "EFI-125: Injector 2", NULL}, + {0x6E, 131, "EFI-131: RPM sensor signal missing [on gearbox casing, also known as Crankshaft sensor, should get reading of 200 to 400 Ohms with multimeter. Two pole connector.]", NULL}, + {0x6B, 132, "EFI-132: Battery Voltage", NULL}, + {0x98, 135, "EFI-135: Injector 3", NULL}, + {0xD2, 143, "EFI-143: Front knock sensor (KS)", NULL}, + {0x99, 145, "EFI-145: Injector 4", NULL}, + {0x0C, 153, "EFI-153: HO2S sensor signal, rear [P0136 (faulty), P0137 (low), or P0138 (high)]", NULL}, + {0xF1, 154, "EFI-154: EGR system leakage", NULL}, + {0x9A, 155, "EFI-155: Injector 5", NULL}, + {0x9B, 165, "EFI-165: Injector 6", NULL}, + {0x18, 211, "EFI-211: CO Potentiometer", NULL}, + {0x0A, 212, "EFI-212: HO2S sensor signal, front", NULL}, + {0x6F, 214, "EFI-214: RPM sensor signal sporadic faulty [on gearbox casing, also known as Crankshaft sensor, should get reading of 200 to 400 Ohms with multimeter. Two pole connector.]", NULL}, + {0xA8, 223, "EFI-223: Idle Air Control (IAC) valve opening signal", NULL}, + {0x82, 225, "EFI-225: A/C pressure sensor signal", NULL}, + {0x1A, 231, "EFI-231: Long term fuel trim, part load", NULL}, + {0x1B, 232, "EFI-232: Long term fuel trim, idling [P0172] [elbow at intake manifold (hidden underneath coolant thermostat), elbow at PTC, vacuum leaks", NULL}, + {0xAA, 233, "EFI-233: Adaptive idle air trim", NULL}, + {0xE1, 233, "EFI-233: Adaptive idle air trim", NULL}, + {0x56, 241, "EFI-241: EGR system", NULL}, + {0xA9, 245, "EFI-245: IAC valve closing signal", NULL}, + {0x7C, 251, "EFI-251: Ambient Temperature sensor signal", NULL}, + {0x78, 311, "EFI-311: Engine RPM high for too long while no Vehicle Speed [see www.volvopedia.de/index.php?title=EFI-311]", NULL}, + {0x70, 314, "EFI-314: Camshaft Position sensor (CMP) signal [next to distributor, cannot verify ohm readings as its all over place from 2k to millions of ohms. When cranking you should get 1.5 to 2hz reading. Dont unplug sensor needs power to work.]", NULL}, + {0x5D, 315, "EFI-315: Canister purge (CP) valve leakage", NULL}, + {0x6D, 315, "EFI-315: Canister purge (CP) valve leakage", NULL}, + {0xA4, 335, "EFI-335: Request for MIL lighting from TCM [P1618] [or possibly Comm Failure between Motronic 4.4 ECM and AW 50-42 TCM]", NULL}, + {0x13, 343, "EFI-343: Fuel Pump Relay", NULL}, + {0x39, 353, "EFI-353: Immobilizer", NULL}, + {0x79, 355, "EFI-355: Mass air flow (MAF) sensor, faulty signal", NULL}, + {0x75, 411, "EFI-411: Throttle Position (TP) sensor signal", NULL}, + {0x59, 413, "EFI-413: EGR temperature sensor signal", NULL}, + {0xE6, 414, "EFI-414: Boost pressure regulation", NULL}, + {0x09, 415, "EFI-415: Boost Pressure sensor signal", NULL}, + {0xE5, 416, "EFI-416: Boost pressure reduction from TCM", NULL}, + {0x77, 422, "EFI-422: Atmospheric pressure sensor signal", NULL}, + {0x11, 425, "EFI-425: Rear HO2S, control (or possibly Temperature warning, level 1)", NULL}, + {0x80, 432, "EFI-432: Temperature warning, level 1", NULL}, + {0xEE, 432, "EFI-432: Temperature warning, level 1", NULL}, + {0xD3, 433, "EFI-433: Rear knock sensor (KS)", NULL}, + {0x0F, 435, "EFI-435: Front HO2S slow response", NULL}, + {0x10, 436, "EFI-436: Rear HO2S compensation [P0133]", NULL}, + {0x50, 442, "EFI-442: Pulsed secondary air injection system signal faulty", NULL}, + {0x28, 443, "EFI-443: TWC (catalysator) efficiency", NULL}, + {0x4D, 444, "EFI-444: Acceleration sensor signal", NULL}, + {0x54, 445, "EFI-445: Pulsed secondary air injection system pump signal", NULL}, + {0x53, 446, "EFI-446: Pulsed secondary air injection system valve leakage", NULL}, + {0x55, 447, "EFI-447: Pulsed secondary air injection system solenoid valve signal", NULL}, + {0x51, 448, "EFI-448: Pulsed secondary air injection system pump flow fault", NULL}, + {0x32, 451, "EFI-451: Misfire cylinder 1", NULL}, + {0x33, 452, "EFI-452: Misfire cylinder 2", NULL}, + {0x34, 453, "EFI-453: Misfire cylinder 3", NULL}, + {0x35, 454, "EFI-454: Misfire cylinder 4", NULL}, + {0x36, 455, "EFI-455: Misfire cylinder 5", NULL}, + {0x37, 456, "EFI-445: Misfire cylinder 6??", NULL}, + {0x81, 513, "EFI-513: Temperature warning, level 2", NULL}, + {0xEF, 513, "EFI-513: Temperature warning, level 2", NULL}, + {0xFD, 514, "EFI-514: Engine coolant fan, low speed", NULL}, + {0x0D, 521, "EFI-521: Front HO2S, preheating", NULL}, + {0x0E, 522, "EFI-522: Rear HO2S preheating malfunction [P0141]", NULL}, + {0xB4, 531, "EFI-531: Power stage group A", NULL}, + {0xB5, 532, "EFI-532: Power stage group B", NULL}, + {0xB6, 533, "EFI-533: Power stage group C", NULL}, + {0xB7, 534, "EFI-534: Power stage group D", NULL}, + {0xF4, 535, "EFI-535: Turbocharger (TC) control valve signal", NULL}, + {0xB8, 536, "EFI-536: Power stage group E??", NULL}, + {0xB9, 537, "EFI-537: Power stage group F??", NULL}, + {0x62, 541, "EFI-541: Canister purge (CP) valve signal", NULL}, + {0x31, 542, "EFI-542: Misfire, more than 1 cylinder", NULL}, + {0x3E, 543, "EFI-543: Misfire exhaust value of at least one cylinder", NULL}, + {0x3D, 544, "EFI-544: Misfire, more than 1 cylinder", NULL}, + {0x4B, 545, "EFI-545: Misfire, at least 1 cylinder", NULL}, + {0x3F, 551, "EFI-551: Misfire, cylinder 1", NULL}, + {0x40, 552, "EFI-552: Misfire, cylinder 2", NULL}, + {0x41, 553, "EFI-553: Misfire, cylinder 3", NULL}, + {0x42, 554, "EFI-554: Misfire, cylinder 4", NULL}, + {0x43, 555, "EFI-555: Misfire, cylinder 5", NULL}, + {0x44, 556, "EFI-556: Misfire, cylinder 6", NULL}, + {0x5E, 611, "EFI-611: Tank system, large leakage. Pressure in fuel tank does not drop rapidly enough. [P0455]", NULL}, + {0x61, 612, "EFI-612: Tank system, Small leakage. While EVAP canister shut-off valve is closed, the canister purge valve is pulsed until reached specific vacuum and this vacuum level has not stayed long enough.[P0442]", NULL}, + {0x5F, 614, "EFI-614: EVAP canister shut off valve flow fault", NULL}, + {0x60, 616, "EFI-616: EVAP canister shut off valve signal", NULL}, + {0x63, 621, "EFI-621: Fuel tank pressure sensor signal", NULL}, + {0xFE, 621, "EFI-621: Fuel tank pressure sensor signal", NULL}, + {0x1D, 666, "EFI-666: DTC in transmission CM", NULL}, + {0, 0, NULL, NULL}, +}; +static struct ecu_info ecu_list[] = { + { .addr = 0x01, .desc = "ABS", .dtc_prefix = "ABS" }, + { .addr = 0x02, .desc = "DSA", .dtc_prefix = "DSA" }, + { .addr = 0x11, .desc = "MSA15.7", .dtc_prefix = "EFI" }, + { .addr = 0x18, .desc = "Add Heater or known later as CPM", .dtc_prefix = "HEA" }, + { .addr = 0x29, .desc = "ECC", .dtc_prefix = "ECC" }, + { .addr = 0x2D, .desc = "VGLA", .dtc_prefix = "GLA" }, + { .addr = 0x2E, .desc = "PSL", .dtc_prefix = "PS" }, + { .addr = 0x2F, .desc = "PSR", .dtc_prefix = "PS" }, + { .addr = 0x41, .desc = "IMMO", .dtc_prefix = "IMM" }, + { .addr = 0x42, .desc = "CCU ( Cab Control Unit ) aka Convertible Top / Roof Module or Later modules known as CAB (Cab Control System)", .dtc_prefix = "unknown" }, + { .addr = 0x51, .desc = "COMBI", .dtc_prefix = "ROP" }, + { .addr = 0x62, .desc = "RTI", .dtc_prefix = "RTI" }, + { .addr = 0x6E, .desc = "Automatic Gearbox", .dtc_prefix = "AT" }, + { .addr = 0x7A, .desc = "EMS2000 DTC_EMS2K_422", .dtc_prefix = "EFI" }, + { .addr = 0x7A, .desc = "Motronic M4.4", .dtc_prefix = "EFI" }, + { .addr = 0x7A, .desc = "Denso", .dtc_prefix = "unknown" }, +}; +static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { + { + .ecu_addr = 0x01, + .dtc_table = dtc_list_01 + }, + { + .ecu_addr = 0x02, + .dtc_table = dtc_list_02 + }, + { + .ecu_addr = 0x11, + .dtc_table = dtc_list_11 + }, + { + .ecu_addr = 0x18, + .dtc_table = dtc_list_18 + }, + { + .ecu_addr = 0x29, + .dtc_table = dtc_list_29 + }, + { + .ecu_addr = 0x2D, + .dtc_table = dtc_list_2d + }, + { + .ecu_addr = 0x2E, + .dtc_table = dtc_list_2e + }, + { + .ecu_addr = 0x2F, + .dtc_table = dtc_list_2f + }, + { + .ecu_addr = 0x41, + .dtc_table = dtc_list_41 + }, + { + .ecu_addr = 0x51, + .dtc_table = dtc_list_51 + }, + { + .ecu_addr = 0x62, + .dtc_table = dtc_list_62 + }, + { + .ecu_addr = 0x6E, + .dtc_table = dtc_list_6e + }, + { + .ecu_addr = 0x7A, + .dtc_table = dtc_list_7a + }, + {0, NULL}, +}; + +#endif // __SCANTOOL_850_DTC_XIAOTEC_H__ From 3cefed903b8c5ec64b417844b2a4c29b4fd80ff4 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Thu, 18 Apr 2024 03:03:16 +0000 Subject: [PATCH 3/4] Add two new sets of DTCs and a parser to generate them --- scantool/scantool_850.c | 4 - scantool/scantool_850/frobbed.h | 46 +++------ scantool/scantool_850/parser.py | 6 +- .../scantool_850/templates/dtc_list.mustache | 2 +- scantool/scantool_850/templates/ecu.mustache | 5 +- .../scantool_850/templates/suffix.mustache | 2 +- scantool/scantool_850/xiaotec.h | 95 ++++++------------- 7 files changed, 51 insertions(+), 109 deletions(-) diff --git a/scantool/scantool_850.c b/scantool/scantool_850.c index d5601ae..20bbcdb 100644 --- a/scantool/scantool_850.c +++ b/scantool/scantool_850.c @@ -54,15 +54,11 @@ #include "scantool_850/dtc.h" #include "scantool_850/ecu.h" -<<<<<<< HEAD -#include "scantool_850/xiaotec.h" -======= #include "scantool_850/basic.h" // DTC list from richard jones // #include "scantool_850/frobbed.h" // DTC list from aleksi (xiaotec) / Android 850 OBD2 app // #include "scantool_850/xiaotec.h" ->>>>>>> bb7f00f (Add code generation from files) static bool have_read_dtcs = false; static struct diag_msg *ecu_id = NULL; diff --git a/scantool/scantool_850/frobbed.h b/scantool/scantool_850/frobbed.h index 804c7cd..196faf7 100644 --- a/scantool/scantool_850/frobbed.h +++ b/scantool/scantool_850/frobbed.h @@ -5,7 +5,7 @@ #include "../scantool_850/dtc.h" #include "../scantool_850/ecu.h" -static struct dtc_table_entry dtc_list_01[] = { +static const struct dtc_table_entry dtc_list_01[] = { {0x10, 311, "Left Front Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, {0x11, 321, "Left Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, {0x13, 211, "Left Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch].", NULL}, @@ -44,7 +44,7 @@ static struct dtc_table_entry dtc_list_01[] = { {0x83, 445, "??ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??.", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_11[] = { +static const struct dtc_table_entry dtc_list_11[] = { {0x00, 131, "Engine Speed (RPM) signal.", NULL}, {0x01, 719, "Secondary Engine Speed signal.", NULL}, {0x02, 132, "Battery Voltage.", NULL}, @@ -86,7 +86,7 @@ static struct dtc_table_entry dtc_list_11[] = { {0xFE, 131, "Engine Speed (RPM) signal.", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_29[] = { +static const struct dtc_table_entry dtc_list_29[] = { {0x30, 314, "Passenger side temp damper motor, no position change [according to xiaotec \"850 OBD-II\" V1.2.9 app]; or might be Floor/Defrost Damper Motor Shorted To Ground Or Power [see \"ac heater system auto.pdf\"].", NULL}, {0x35, 412, "Driver's (or passenger's) side interior temperature sensor inlet fan shorted to earth (or signal too low) [see \"ac heater system auto.pdf\"].", NULL}, {0x36, 413, "Driver's (or passenger's) side interior temperature sensor inlet fan, no control voltage (or signal too high) [see \"ac heater system auto.pdf\"].", NULL}, @@ -94,7 +94,7 @@ static struct dtc_table_entry dtc_list_29[] = { {0x38, 411, "Blower fan seized or drawing excess current [or blower fan obstruction, or power stage surge protector problem (ECC-419)].", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_41[] = { +static const struct dtc_table_entry dtc_list_41[] = { {0x01, 112, "Internal EEPROM memory fault.", NULL}, {0x06, 223, "Comm fault from Transponder to IMMO Control Module.", NULL}, {0x07, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, @@ -113,7 +113,7 @@ static struct dtc_table_entry dtc_list_41[] = { {0xF8, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_51[] = { +static const struct dtc_table_entry dtc_list_51[] = { {0x01, 222, "Vehicle Speed Signal too high.", NULL}, {0x02, 221, "Vehicle Speed Signal missing [usually due to bad ABS module solders] [P0500].", NULL}, {0x03, 114, "Fuel Level sensor stuck / signal constant for 94 miles.", NULL}, @@ -134,7 +134,7 @@ static struct dtc_table_entry dtc_list_51[] = { {0x20, 232, "COMBI is not yet programmed.", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_58[] = { +static const struct dtc_table_entry dtc_list_58[] = { {0x01, 112, "Crash Sensor Module internal fault.", NULL}, {0x02, 211, "Driver Airbag short circuit (in contact reel and/or in SRS harness to airbag, connectors, or igniter).", NULL}, {0x03, 212, "Driver Airbag open circuit (in SRS harness, connector, or airbag).", NULL}, @@ -197,32 +197,16 @@ static struct ecu_info ecu_list[] = { { .addr = 0x41, .desc = "IMM", .dtc_prefix = "IMM" }, { .addr = 0x51, .desc = "CI", .dtc_prefix = "CI" }, { .addr = 0x58, .desc = "SRS", .dtc_prefix = "SRS" }, + {0, NULL, NULL, NULL} }; -static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { - { - .ecu_addr = 0x01, - .dtc_table = dtc_list_01 - }, - { - .ecu_addr = 0x11, - .dtc_table = dtc_list_11 - }, - { - .ecu_addr = 0x29, - .dtc_table = dtc_list_29 - }, - { - .ecu_addr = 0x41, - .dtc_table = dtc_list_41 - }, - { - .ecu_addr = 0x51, - .dtc_table = dtc_list_51 - }, - { - .ecu_addr = 0x58, - .dtc_table = dtc_list_58 - }, + +static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { + {0x01, dtc_list_01}, + {0x11, dtc_list_11}, + {0x29, dtc_list_29}, + {0x41, dtc_list_41}, + {0x51, dtc_list_51}, + {0x58, dtc_list_58}, {0, NULL}, }; diff --git a/scantool/scantool_850/parser.py b/scantool/scantool_850/parser.py index 80d2714..0dd2d67 100644 --- a/scantool/scantool_850/parser.py +++ b/scantool/scantool_850/parser.py @@ -182,13 +182,15 @@ def main(): print('static struct ecu_info ecu_list[] = {') for ecu in ecus: print(' { .addr = 0x' + ecu.address + ', .desc = "' + ecu.description + '", .dtc_prefix = "' + ecu.prefix + '" },') + print(' {0, NULL, NULL, NULL}') print('};') + print() suffix_template = suffix_template_file.read() suffix_template = suffix_template.replace('{{name}}', name.upper()) suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(ecu_list)) print(suffix_template) -# Example call: python3 parser.py richard export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.h -# Example call: python3 parser.py aleksi DTC_List_850OBDII_D2.txt templates/ xiaotec > xiaotec.h +# Example call: python3 parser.py richard sources/export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.h +# Example call: python3 parser.py aleksi sources/DTC_List_850OBDII_D2.txt templates/ xiaotec > xiaotec.h main() \ No newline at end of file diff --git a/scantool/scantool_850/templates/dtc_list.mustache b/scantool/scantool_850/templates/dtc_list.mustache index da4a501..8ff3fef 100644 --- a/scantool/scantool_850/templates/dtc_list.mustache +++ b/scantool/scantool_850/templates/dtc_list.mustache @@ -1,4 +1,4 @@ -static struct dtc_table_entry {{dtc_list_name}}[] = { +static const struct dtc_table_entry {{dtc_list_name}}[] = { {{dtc_list}} {0, 0, NULL, NULL}, }; \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu.mustache b/scantool/scantool_850/templates/ecu.mustache index 02ce1b2..65f8e49 100644 --- a/scantool/scantool_850/templates/ecu.mustache +++ b/scantool/scantool_850/templates/ecu.mustache @@ -1,4 +1 @@ - { - .ecu_addr = 0x{{ecu}}, - .dtc_table = {{dtc_table}} - }, \ No newline at end of file + {0x{{ecu}}, {{dtc_table}}}, \ No newline at end of file diff --git a/scantool/scantool_850/templates/suffix.mustache b/scantool/scantool_850/templates/suffix.mustache index 3bf58e7..ec0467d 100644 --- a/scantool/scantool_850/templates/suffix.mustache +++ b/scantool/scantool_850/templates/suffix.mustache @@ -1,4 +1,4 @@ -static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { +static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {{ecu_list}} {0, NULL}, }; diff --git a/scantool/scantool_850/xiaotec.h b/scantool/scantool_850/xiaotec.h index aa2924c..1d715ab 100644 --- a/scantool/scantool_850/xiaotec.h +++ b/scantool/scantool_850/xiaotec.h @@ -5,7 +5,7 @@ #include "../scantool_850/dtc.h" #include "../scantool_850/ecu.h" -static struct dtc_table_entry dtc_list_01[] = { +static const struct dtc_table_entry dtc_list_01[] = { {0x05, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, {0x30, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, {0x10, 311, "ABS-311: Left Front Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, @@ -45,7 +45,7 @@ static struct dtc_table_entry dtc_list_01[] = { {0x83, 445, "ABS-445: ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_02[] = { +static const struct dtc_table_entry dtc_list_02[] = { {0x01, 131, "DSA-131 Torque reduction signal, signal faulty", NULL}, {0x02, 231, "DSA-231 Throttle position sensor signal, signal missing ", NULL}, {0x03, 232, "DSA-232 Throttle position sensor signal, signal faulty", NULL}, @@ -65,7 +65,7 @@ static struct dtc_table_entry dtc_list_02[] = { {0x11, 112, "DSA-112 Control Module, EEPROM fault", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_11[] = { +static const struct dtc_table_entry dtc_list_11[] = { {0x00, 131, "EFI-131: Engine Speed (RPM) signal", NULL}, {0x01, 719, "EFI-719: Secondary Engine Speed signal", NULL}, {0x02, 132, "EFI-132: Battery Voltage", NULL}, @@ -106,7 +106,7 @@ static struct dtc_table_entry dtc_list_11[] = { {0x36, 732, "EFI-732: Accelerator Pedal Position sensor signal", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_18[] = { +static const struct dtc_table_entry dtc_list_18[] = { {0x31, 801, "HEA-801: Coolant Temperature Sensor, Signal too High", NULL}, {0x32, 802, "HEA-802: Coolant Temperature Sensor, Signal too Low", NULL}, {0x33, 803, "HEA-803: Coolant Temperature Sensor, Signal faulty", NULL}, @@ -137,7 +137,7 @@ static struct dtc_table_entry dtc_list_18[] = { {0x51, 898, "HEA-898: Factory set DTC, no fault with heater", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_29[] = { +static const struct dtc_table_entry dtc_list_29[] = { {0x0A, 221, "ECC-221: Air distribution damper motor position sensor Signal Low", NULL}, {0x0B, 222, "ECC-222: Air distribution damper motor position sensor Signal High", NULL}, {0x13, 322, "ECC-322: Air distribution damper motor position, no position change", NULL}, @@ -180,7 +180,7 @@ static struct dtc_table_entry dtc_list_29[] = { {0x51, 442, "ECC-442: Program downloading, control module. Faulty", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_2d[] = { +static const struct dtc_table_entry dtc_list_2d[] = { {0x41, 114, "GLA-114: Control Module, Fault in EEPROM", NULL}, {0x42, 512, "GLA-512: Drivers Door Lock Switch, Unlocking Signal too Low / Short to Ground", NULL}, {0x43, 521, "GLA-521: Drivers Central Locking Switch, Signal too Low / Short to Ground", NULL}, @@ -212,7 +212,7 @@ static struct dtc_table_entry dtc_list_2d[] = { {0x6E, 455, "GLA-455: Immobilizer, VGLA code Signal Faulty", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_2e[] = { +static const struct dtc_table_entry dtc_list_2e[] = { {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, @@ -244,7 +244,7 @@ static struct dtc_table_entry dtc_list_2e[] = { {0x1D, 332, "PS-332: Original position not stored", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_2f[] = { +static const struct dtc_table_entry dtc_list_2f[] = { {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, @@ -276,7 +276,7 @@ static struct dtc_table_entry dtc_list_2f[] = { {0x1D, 332, "PS-332: Original position not stored", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_41[] = { +static const struct dtc_table_entry dtc_list_41[] = { {0x01, 112, "IMM-112: Internal EEPROM memory fault", NULL}, {0x02, 211, "IMM-211/213: Comm fault with engine ECU", NULL}, {0x03, 212, "IMM-212/233: No Contact with Antenna.\nOr wrong antenna. Ex. Immo2 on 850 has 8??, Immo3 on S/V40 has 3.3??, V70 has 5?? as rough resistance measurement.\nAntenna is tuned inside IMMO with capacitors and resistors for antennas inductivity to create LC circuit.\nOther reasons:\nThe cable between control module Pin #9 or #10 is short to gnd or +12V.", NULL}, @@ -302,7 +302,7 @@ static struct dtc_table_entry dtc_list_41[] = { {0xF8, 336, "IMM-336: Control circuit to VGLA, fault in VGLA or LED circuit", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_51[] = { +static const struct dtc_table_entry dtc_list_51[] = { {0x01, 222, "CI-222: Vehicle Speed signal too high", NULL}, {0x02, 221, "CI-221: Vehicle speed signal missing [bad ABS module solders?]", NULL}, {0x03, 114, "CI-114: Fuel Level sensor stuck", NULL}, @@ -462,7 +462,7 @@ static struct dtc_table_entry dtc_list_51[] = { {0x78, 452, "ROP-452: Control Module, handling fault during Self Test", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_62[] = { +static const struct dtc_table_entry dtc_list_62[] = { {0x10, 112, "RTI-112: Control Module, Internal Fault Memory circuits", NULL}, {0x20, 113, "RTI-113: Control Module, Internal Fault, Internal comms", NULL}, {0x30, 114, "RTI-114: Control Module, Internal Fault, Display screen comms", NULL}, @@ -476,7 +476,7 @@ static struct dtc_table_entry dtc_list_62[] = { {0x70, 141, "RTI-141: TMC/FM receiver, faulty signal", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_6e[] = { +static const struct dtc_table_entry dtc_list_6e[] = { {0x02, 122, "AT-122: Shift Solenoid S1 circuit, open [eg, bad wiring or solenoid, or low/dirty fluid]", NULL}, {0x03, 121, "AT-121: Shift Solenoid S1 circuit, short to ground [eg, bad wiring, solenoid, or TCM (ie, ECU 6E), or low/dirty fluid]", NULL}, {0x08, 222, "AT-222: Shift solenoid S2 circuit", NULL}, @@ -520,7 +520,7 @@ static struct dtc_table_entry dtc_list_6e[] = { {0xE0, 527, "AT-527: Control Module Communication", NULL}, {0, 0, NULL, NULL}, }; -static struct dtc_table_entry dtc_list_7a[] = { +static const struct dtc_table_entry dtc_list_7a[] = { {0x0A, 422, "EFI-422: Atmospheric pressure sensor signal", NULL}, {0x0F, 122, "EFI-122: Intake Air Temperature (IAT) Sensor Faulty", NULL}, {0x12, 414, "EFI-414: Boost pressure regulation", NULL}, @@ -682,60 +682,23 @@ static struct ecu_info ecu_list[] = { { .addr = 0x7A, .desc = "EMS2000 DTC_EMS2K_422", .dtc_prefix = "EFI" }, { .addr = 0x7A, .desc = "Motronic M4.4", .dtc_prefix = "EFI" }, { .addr = 0x7A, .desc = "Denso", .dtc_prefix = "unknown" }, + {0, NULL, NULL, NULL} }; -static struct ecu_dtc_table_map_entry ecu_dtc_map[] = { - { - .ecu_addr = 0x01, - .dtc_table = dtc_list_01 - }, - { - .ecu_addr = 0x02, - .dtc_table = dtc_list_02 - }, - { - .ecu_addr = 0x11, - .dtc_table = dtc_list_11 - }, - { - .ecu_addr = 0x18, - .dtc_table = dtc_list_18 - }, - { - .ecu_addr = 0x29, - .dtc_table = dtc_list_29 - }, - { - .ecu_addr = 0x2D, - .dtc_table = dtc_list_2d - }, - { - .ecu_addr = 0x2E, - .dtc_table = dtc_list_2e - }, - { - .ecu_addr = 0x2F, - .dtc_table = dtc_list_2f - }, - { - .ecu_addr = 0x41, - .dtc_table = dtc_list_41 - }, - { - .ecu_addr = 0x51, - .dtc_table = dtc_list_51 - }, - { - .ecu_addr = 0x62, - .dtc_table = dtc_list_62 - }, - { - .ecu_addr = 0x6E, - .dtc_table = dtc_list_6e - }, - { - .ecu_addr = 0x7A, - .dtc_table = dtc_list_7a - }, + +static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { + {0x01, dtc_list_01}, + {0x02, dtc_list_02}, + {0x11, dtc_list_11}, + {0x18, dtc_list_18}, + {0x29, dtc_list_29}, + {0x2D, dtc_list_2d}, + {0x2E, dtc_list_2e}, + {0x2F, dtc_list_2f}, + {0x41, dtc_list_41}, + {0x51, dtc_list_51}, + {0x62, dtc_list_62}, + {0x6E, dtc_list_6e}, + {0x7A, dtc_list_7a}, {0, NULL}, }; From 78a73ecc3bc2f37dbe1292b5642f8e3c77be9535 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Sat, 27 Apr 2024 20:42:51 +0000 Subject: [PATCH 4/4] Rebase and refactor to match the new structure for ecu/dtc.h --- scantool/CMakeLists.txt | 1 + scantool/scantool_850.c | 5 --- scantool/scantool_850/config.h | 16 +++++++ scantool/scantool_850/dtc.c | 4 +- scantool/scantool_850/dtc.h | 1 - scantool/scantool_850/ecu.c | 3 ++ .../scantool_850/{frobbed.h => frobbed.c} | 29 +++++++------ scantool/scantool_850/parser.py | 28 +++++++----- .../scantool_850/templates/dtc_list.mustache | 2 +- scantool/scantool_850/templates/ecu.mustache | 1 - .../scantool_850/templates/ecu_entry.mustache | 1 + .../scantool_850/templates/ecu_item.mustache | 1 + .../scantool_850/templates/ecu_list.mustache | 4 ++ .../scantool_850/templates/prefix.mustache | 11 ++--- .../scantool_850/templates/suffix.mustache | 4 +- .../scantool_850/{xiaotec.h => xiaotec.c} | 43 ++++++++++--------- 16 files changed, 93 insertions(+), 61 deletions(-) create mode 100644 scantool/scantool_850/config.h rename scantool/scantool_850/{frobbed.h => frobbed.c} (96%) create mode 100644 scantool/scantool_850/templates/ecu_entry.mustache create mode 100644 scantool/scantool_850/templates/ecu_item.mustache create mode 100644 scantool/scantool_850/templates/ecu_list.mustache rename scantool/scantool_850/{xiaotec.h => xiaotec.c} (98%) diff --git a/scantool/CMakeLists.txt b/scantool/CMakeLists.txt index a0ba2c3..37de217 100644 --- a/scantool/CMakeLists.txt +++ b/scantool/CMakeLists.txt @@ -126,6 +126,7 @@ set (CLI_SRCS scantool_cli.c scantool_diag.c scantool_set.c set (SCANTOOL_SRCS scantool.c scantool_test.c scantool_vag.c scantool_850.c scantool_dyno.c scantool_850/dtc.c scantool_850/ecu.c + scantool_850/frobbed.c scantool_850/xiaotec.c scantool_obd.c ${FREEDIAG_RC}) diff --git a/scantool/scantool_850.c b/scantool/scantool_850.c index 20bbcdb..1caa2fc 100644 --- a/scantool/scantool_850.c +++ b/scantool/scantool_850.c @@ -54,11 +54,6 @@ #include "scantool_850/dtc.h" #include "scantool_850/ecu.h" -#include "scantool_850/basic.h" -// DTC list from richard jones -// #include "scantool_850/frobbed.h" -// DTC list from aleksi (xiaotec) / Android 850 OBD2 app -// #include "scantool_850/xiaotec.h" static bool have_read_dtcs = false; static struct diag_msg *ecu_id = NULL; diff --git a/scantool/scantool_850/config.h b/scantool/scantool_850/config.h new file mode 100644 index 0000000..1ad8df2 --- /dev/null +++ b/scantool/scantool_850/config.h @@ -0,0 +1,16 @@ +#ifndef __SCANTOOL_850_CONFIG_H__ +#define __SCANTOOL_850_CONFIG_H__ + + +// There are three possible sources for DTC/ECU codes +// The default +#define DEFAULT_850_DTC +#define DEFAULT_850_ECU + +// Sourced from Aleksi (author of the 850 OBD Android App) +// #define __SCANTOOL_850_DTC_XIAOTEC__ + +// Sourced from Richard Jones (https://jonesrh.info/volvo850/index.html) +// #define __SCANTOOL_850_DTC_FROBBED__ + +#endif // __SCANTOOL_850_CONFIG_H__ \ No newline at end of file diff --git a/scantool/scantool_850/dtc.c b/scantool/scantool_850/dtc.c index 245c529..13475fc 100644 --- a/scantool/scantool_850/dtc.c +++ b/scantool/scantool_850/dtc.c @@ -1,5 +1,6 @@ #include #include "dtc.h" +#include "config.h" const struct dtc_table_entry *dtctable_by_addr(uint8_t addr) { const struct ecu_dtc_table_map_entry *ecu_dtc_entry; @@ -11,6 +12,7 @@ const struct dtc_table_entry *dtctable_by_addr(uint8_t addr) { return NULL; } +#ifdef DEFAULT_850_DTC static const struct dtc_table_entry aw50_dtc[] = { {0x13, 332, "Torque converter lock-up solenoid open circuit", NULL}, {0, 0, NULL, NULL}, @@ -32,4 +34,4 @@ const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {0x7a, m44_dtc}, {0, NULL}, }; - +#endif diff --git a/scantool/scantool_850/dtc.h b/scantool/scantool_850/dtc.h index 1837ad4..9caef53 100644 --- a/scantool/scantool_850/dtc.h +++ b/scantool/scantool_850/dtc.h @@ -21,6 +21,5 @@ extern const struct ecu_dtc_table_map_entry ecu_dtc_map[]; /** find DTC table by ECU address. NULL if not found */ const struct dtc_table_entry *dtctable_by_addr(uint8_t addr); - #endif // __SCANTOOL_850_DTC_H__ diff --git a/scantool/scantool_850/ecu.c b/scantool/scantool_850/ecu.c index 0f3138a..69d2639 100644 --- a/scantool/scantool_850/ecu.c +++ b/scantool/scantool_850/ecu.c @@ -3,6 +3,7 @@ #include "../diag.h" #include "ecu.h" +#include "config.h" const struct ecu_info *ecu_info_by_addr(uint8_t addr) { const struct ecu_info *ecu_entry; @@ -28,6 +29,7 @@ const struct ecu_info *ecu_info_by_name(const char *name) { } +#ifdef DEFAULT_850_ECU const struct ecu_info ecu_list[] = { {0x01, "abs", "antilock brakes", "ABS"}, @@ -58,3 +60,4 @@ const struct ecu_info ecu_list[] = { {0, NULL, NULL, NULL} }; +#endif \ No newline at end of file diff --git a/scantool/scantool_850/frobbed.h b/scantool/scantool_850/frobbed.c similarity index 96% rename from scantool/scantool_850/frobbed.h rename to scantool/scantool_850/frobbed.c index 196faf7..52a32e5 100644 --- a/scantool/scantool_850/frobbed.h +++ b/scantool/scantool_850/frobbed.c @@ -1,11 +1,12 @@ -#ifndef __SCANTOOL_850_DTC_FROBBED_H__ -#define __SCANTOOL_850_DTC_FROBBED_H__ - #include -#include "../scantool_850/dtc.h" -#include "../scantool_850/ecu.h" +#include "dtc.h" +#include "ecu.h" +#include "config.h" + +#ifdef __SCANTOOL_850_DTC_FROBBED__ + -static const struct dtc_table_entry dtc_list_01[] = { +const struct dtc_table_entry dtc_list_01[] = { {0x10, 311, "Left Front Wheel Sensor, open/short [or bad ABS module solders or ignition switch].", NULL}, {0x11, 321, "Left Front Wheel Sensor, irregular > 25 mph (ie, interference or excess oscillation > 40 km/h) [or bad ABS module solders or ignition switch].", NULL}, {0x13, 211, "Left Front Wheel Sensor, wrong wheel speed (ie, signal absent yet circuit intact, or signal absent when moving off) [or bad ABS module solders or ignition switch].", NULL}, @@ -44,7 +45,7 @@ static const struct dtc_table_entry dtc_list_01[] = { {0x83, 445, "??ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??.", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_11[] = { +const struct dtc_table_entry dtc_list_11[] = { {0x00, 131, "Engine Speed (RPM) signal.", NULL}, {0x01, 719, "Secondary Engine Speed signal.", NULL}, {0x02, 132, "Battery Voltage.", NULL}, @@ -86,7 +87,7 @@ static const struct dtc_table_entry dtc_list_11[] = { {0xFE, 131, "Engine Speed (RPM) signal.", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_29[] = { +const struct dtc_table_entry dtc_list_29[] = { {0x30, 314, "Passenger side temp damper motor, no position change [according to xiaotec \"850 OBD-II\" V1.2.9 app]; or might be Floor/Defrost Damper Motor Shorted To Ground Or Power [see \"ac heater system auto.pdf\"].", NULL}, {0x35, 412, "Driver's (or passenger's) side interior temperature sensor inlet fan shorted to earth (or signal too low) [see \"ac heater system auto.pdf\"].", NULL}, {0x36, 413, "Driver's (or passenger's) side interior temperature sensor inlet fan, no control voltage (or signal too high) [see \"ac heater system auto.pdf\"].", NULL}, @@ -94,7 +95,7 @@ static const struct dtc_table_entry dtc_list_29[] = { {0x38, 411, "Blower fan seized or drawing excess current [or blower fan obstruction, or power stage surge protector problem (ECC-419)].", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_41[] = { +const struct dtc_table_entry dtc_list_41[] = { {0x01, 112, "Internal EEPROM memory fault.", NULL}, {0x06, 223, "Comm fault from Transponder to IMMO Control Module.", NULL}, {0x07, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, @@ -113,7 +114,7 @@ static const struct dtc_table_entry dtc_list_41[] = { {0xF8, 336, "Control circuit to VGLA, fault in VGLA or LED circuit (P600).", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_51[] = { +const struct dtc_table_entry dtc_list_51[] = { {0x01, 222, "Vehicle Speed Signal too high.", NULL}, {0x02, 221, "Vehicle Speed Signal missing [usually due to bad ABS module solders] [P0500].", NULL}, {0x03, 114, "Fuel Level sensor stuck / signal constant for 94 miles.", NULL}, @@ -134,7 +135,7 @@ static const struct dtc_table_entry dtc_list_51[] = { {0x20, 232, "COMBI is not yet programmed.", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_58[] = { +const struct dtc_table_entry dtc_list_58[] = { {0x01, 112, "Crash Sensor Module internal fault.", NULL}, {0x02, 211, "Driver Airbag short circuit (in contact reel and/or in SRS harness to airbag, connectors, or igniter).", NULL}, {0x03, 212, "Driver Airbag open circuit (in SRS harness, connector, or airbag).", NULL}, @@ -190,7 +191,7 @@ static const struct dtc_table_entry dtc_list_58[] = { {0xC7, 114, "Control Module faulty signal.", NULL}, {0, 0, NULL, NULL}, }; -static struct ecu_info ecu_list[] = { +const struct ecu_info ecu_list[] = { { .addr = 0x01, .desc = "ABS", .dtc_prefix = "ABS" }, { .addr = 0x11, .desc = "EFI", .dtc_prefix = "EFI" }, { .addr = 0x29, .desc = "ECC", .dtc_prefix = "ECC" }, @@ -200,7 +201,7 @@ static struct ecu_info ecu_list[] = { {0, NULL, NULL, NULL} }; -static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { +const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {0x01, dtc_list_01}, {0x11, dtc_list_11}, {0x29, dtc_list_29}, @@ -210,4 +211,4 @@ static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {0, NULL}, }; -#endif // __SCANTOOL_850_DTC_FROBBED_H__ +#endif // __SCANTOOL_850_DTC_FROBBED__ diff --git a/scantool/scantool_850/parser.py b/scantool/scantool_850/parser.py index 0dd2d67..3f1bc4c 100644 --- a/scantool/scantool_850/parser.py +++ b/scantool/scantool_850/parser.py @@ -153,7 +153,9 @@ def main(): with (open(directory + '/dtc.mustache', 'r') as dtc_template_file, open(directory + '/dtc_list.mustache', 'r') as dtc_list_template_file, - open(directory + '/ecu.mustache', 'r') as ecu_template_file, + open(directory + '/ecu_entry.mustache', 'r') as ecu_template_file, + open(directory + '/ecu_item.mustache', 'r') as ecu_item_template_file, + open(directory + '/ecu_list.mustache', 'r') as ecu_list_template_file, open(directory + '/prefix.mustache', 'r') as prefix_template_file, open(directory + '/suffix.mustache', 'r') as suffix_template_file): @@ -165,11 +167,11 @@ def main(): dtc_list_template = dtc_list_template_file.read() ecu_template = ecu_template_file.read() - ecu_list = [] + dtc_ecu_list = [] for ecu in ecu_map.keys(): out = ecu_template.replace('{{ecu}}', ecu) out = out.replace('{{dtc_table}}', 'dtc_list_' + ecu.lower()) - ecu_list.append(out) + dtc_ecu_list.append(out) dtcs = ecu_map[ecu] dtc_list = [] @@ -179,18 +181,24 @@ def main(): out = out.replace('{{dtc_list_name}}', 'dtc_list_' + ecu.lower()) print(out) - print('static struct ecu_info ecu_list[] = {') + ecu_list_template = ecu_list_template_file.read() + ecu_item_template = ecu_item_template_file.read() + + ecu_list = [] for ecu in ecus: - print(' { .addr = 0x' + ecu.address + ', .desc = "' + ecu.description + '", .dtc_prefix = "' + ecu.prefix + '" },') - print(' {0, NULL, NULL, NULL}') - print('};') + ecu_list.append(ecu_item_template + .replace('{{ecu_address}}', ecu.address) + .replace('{{ecu_description}}', ecu.description) + .replace('{{ecu_prefix}}', ecu.prefix)) +# ecu_list.append(' { .addr = 0x' + ecu.address + ', .desc = "' + ecu.description + '", .dtc_prefix = "' + ecu.prefix + '" },') + print(ecu_list_template.replace('{{ecu_list}}', '\n'.join(ecu_list))) print() suffix_template = suffix_template_file.read() suffix_template = suffix_template.replace('{{name}}', name.upper()) - suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(ecu_list)) + suffix_template = suffix_template.replace('{{ecu_list}}', '\n'.join(dtc_ecu_list)) print(suffix_template) -# Example call: python3 parser.py richard sources/export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.h -# Example call: python3 parser.py aleksi sources/DTC_List_850OBDII_D2.txt templates/ xiaotec > xiaotec.h +# Example call: python3 parser.py richard sources/export_2024-04-06_frobbed.txt templates/ frobbed > frobbed.c +# Example call: python3 parser.py aleksi sources/DTC_List_850OBDII_D2.txt templates/ xiaotec > xiaotec.c main() \ No newline at end of file diff --git a/scantool/scantool_850/templates/dtc_list.mustache b/scantool/scantool_850/templates/dtc_list.mustache index 8ff3fef..ac5fe2d 100644 --- a/scantool/scantool_850/templates/dtc_list.mustache +++ b/scantool/scantool_850/templates/dtc_list.mustache @@ -1,4 +1,4 @@ -static const struct dtc_table_entry {{dtc_list_name}}[] = { +const struct dtc_table_entry {{dtc_list_name}}[] = { {{dtc_list}} {0, 0, NULL, NULL}, }; \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu.mustache b/scantool/scantool_850/templates/ecu.mustache index 65f8e49..e69de29 100644 --- a/scantool/scantool_850/templates/ecu.mustache +++ b/scantool/scantool_850/templates/ecu.mustache @@ -1 +0,0 @@ - {0x{{ecu}}, {{dtc_table}}}, \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu_entry.mustache b/scantool/scantool_850/templates/ecu_entry.mustache new file mode 100644 index 0000000..65f8e49 --- /dev/null +++ b/scantool/scantool_850/templates/ecu_entry.mustache @@ -0,0 +1 @@ + {0x{{ecu}}, {{dtc_table}}}, \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu_item.mustache b/scantool/scantool_850/templates/ecu_item.mustache new file mode 100644 index 0000000..66e54f2 --- /dev/null +++ b/scantool/scantool_850/templates/ecu_item.mustache @@ -0,0 +1 @@ + { .addr = 0x{{ecu_address}}, .desc = "{{ecu_description}}", .dtc_prefix = "{{ecu_prefix}}" }, \ No newline at end of file diff --git a/scantool/scantool_850/templates/ecu_list.mustache b/scantool/scantool_850/templates/ecu_list.mustache new file mode 100644 index 0000000..73e5f86 --- /dev/null +++ b/scantool/scantool_850/templates/ecu_list.mustache @@ -0,0 +1,4 @@ +const struct ecu_info ecu_list[] = { +{{ecu_list}} + {0, NULL, NULL, NULL} +}; \ No newline at end of file diff --git a/scantool/scantool_850/templates/prefix.mustache b/scantool/scantool_850/templates/prefix.mustache index 7c6bed2..3718f90 100644 --- a/scantool/scantool_850/templates/prefix.mustache +++ b/scantool/scantool_850/templates/prefix.mustache @@ -1,6 +1,7 @@ -#ifndef __SCANTOOL_850_DTC_{{name}}_H__ -#define __SCANTOOL_850_DTC_{{name}}_H__ - #include -#include "../scantool_850/dtc.h" -#include "../scantool_850/ecu.h" +#include "dtc.h" +#include "ecu.h" +#include "config.h" + +#ifdef __SCANTOOL_850_DTC_{{name}}__ + diff --git a/scantool/scantool_850/templates/suffix.mustache b/scantool/scantool_850/templates/suffix.mustache index ec0467d..6f7d40b 100644 --- a/scantool/scantool_850/templates/suffix.mustache +++ b/scantool/scantool_850/templates/suffix.mustache @@ -1,6 +1,6 @@ -static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { +const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {{ecu_list}} {0, NULL}, }; -#endif // __SCANTOOL_850_DTC_{{name}}_H__ \ No newline at end of file +#endif // __SCANTOOL_850_DTC_{{name}}__ \ No newline at end of file diff --git a/scantool/scantool_850/xiaotec.h b/scantool/scantool_850/xiaotec.c similarity index 98% rename from scantool/scantool_850/xiaotec.h rename to scantool/scantool_850/xiaotec.c index 1d715ab..eeaa7b4 100644 --- a/scantool/scantool_850/xiaotec.h +++ b/scantool/scantool_850/xiaotec.c @@ -1,11 +1,12 @@ -#ifndef __SCANTOOL_850_DTC_XIAOTEC_H__ -#define __SCANTOOL_850_DTC_XIAOTEC_H__ - #include -#include "../scantool_850/dtc.h" -#include "../scantool_850/ecu.h" +#include "dtc.h" +#include "ecu.h" +#include "config.h" + +#ifdef __SCANTOOL_850_DTC_XIAOTEC__ + -static const struct dtc_table_entry dtc_list_01[] = { +const struct dtc_table_entry dtc_list_01[] = { {0x05, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, {0x30, 313, "ABS-313: Left Rear Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, {0x10, 311, "ABS-311: Left Front Wheel Sensor, open/short? [or bad ABS module solders or ignition switch]", NULL}, @@ -45,7 +46,7 @@ static const struct dtc_table_entry dtc_list_01[] = { {0x83, 445, "ABS-445: ABS Module, either inlet or return valve circuit fault [or bad wiring, bad ABS module solders, combination relay, hydraulic modulator, ignition switch, or bad ABS module]??", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_02[] = { +const struct dtc_table_entry dtc_list_02[] = { {0x01, 131, "DSA-131 Torque reduction signal, signal faulty", NULL}, {0x02, 231, "DSA-231 Throttle position sensor signal, signal missing ", NULL}, {0x03, 232, "DSA-232 Throttle position sensor signal, signal faulty", NULL}, @@ -65,7 +66,7 @@ static const struct dtc_table_entry dtc_list_02[] = { {0x11, 112, "DSA-112 Control Module, EEPROM fault", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_11[] = { +const struct dtc_table_entry dtc_list_11[] = { {0x00, 131, "EFI-131: Engine Speed (RPM) signal", NULL}, {0x01, 719, "EFI-719: Secondary Engine Speed signal", NULL}, {0x02, 132, "EFI-132: Battery Voltage", NULL}, @@ -106,7 +107,7 @@ static const struct dtc_table_entry dtc_list_11[] = { {0x36, 732, "EFI-732: Accelerator Pedal Position sensor signal", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_18[] = { +const struct dtc_table_entry dtc_list_18[] = { {0x31, 801, "HEA-801: Coolant Temperature Sensor, Signal too High", NULL}, {0x32, 802, "HEA-802: Coolant Temperature Sensor, Signal too Low", NULL}, {0x33, 803, "HEA-803: Coolant Temperature Sensor, Signal faulty", NULL}, @@ -137,7 +138,7 @@ static const struct dtc_table_entry dtc_list_18[] = { {0x51, 898, "HEA-898: Factory set DTC, no fault with heater", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_29[] = { +const struct dtc_table_entry dtc_list_29[] = { {0x0A, 221, "ECC-221: Air distribution damper motor position sensor Signal Low", NULL}, {0x0B, 222, "ECC-222: Air distribution damper motor position sensor Signal High", NULL}, {0x13, 322, "ECC-322: Air distribution damper motor position, no position change", NULL}, @@ -180,7 +181,7 @@ static const struct dtc_table_entry dtc_list_29[] = { {0x51, 442, "ECC-442: Program downloading, control module. Faulty", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_2d[] = { +const struct dtc_table_entry dtc_list_2d[] = { {0x41, 114, "GLA-114: Control Module, Fault in EEPROM", NULL}, {0x42, 512, "GLA-512: Drivers Door Lock Switch, Unlocking Signal too Low / Short to Ground", NULL}, {0x43, 521, "GLA-521: Drivers Central Locking Switch, Signal too Low / Short to Ground", NULL}, @@ -212,7 +213,7 @@ static const struct dtc_table_entry dtc_list_2d[] = { {0x6E, 455, "GLA-455: Immobilizer, VGLA code Signal Faulty", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_2e[] = { +const struct dtc_table_entry dtc_list_2e[] = { {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, @@ -244,7 +245,7 @@ static const struct dtc_table_entry dtc_list_2e[] = { {0x1D, 332, "PS-332: Original position not stored", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_2f[] = { +const struct dtc_table_entry dtc_list_2f[] = { {0x01, 112, "PS-112: Legroom Motor 1, Pot signal too high", NULL}, {0x02, 121, "PS-121: Backrest Motor 2, Pot signal too high", NULL}, {0x03, 122, "PS-122: Seat Rear Edge Motor 3, Pot signal too high", NULL}, @@ -276,7 +277,7 @@ static const struct dtc_table_entry dtc_list_2f[] = { {0x1D, 332, "PS-332: Original position not stored", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_41[] = { +const struct dtc_table_entry dtc_list_41[] = { {0x01, 112, "IMM-112: Internal EEPROM memory fault", NULL}, {0x02, 211, "IMM-211/213: Comm fault with engine ECU", NULL}, {0x03, 212, "IMM-212/233: No Contact with Antenna.\nOr wrong antenna. Ex. Immo2 on 850 has 8??, Immo3 on S/V40 has 3.3??, V70 has 5?? as rough resistance measurement.\nAntenna is tuned inside IMMO with capacitors and resistors for antennas inductivity to create LC circuit.\nOther reasons:\nThe cable between control module Pin #9 or #10 is short to gnd or +12V.", NULL}, @@ -302,7 +303,7 @@ static const struct dtc_table_entry dtc_list_41[] = { {0xF8, 336, "IMM-336: Control circuit to VGLA, fault in VGLA or LED circuit", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_51[] = { +const struct dtc_table_entry dtc_list_51[] = { {0x01, 222, "CI-222: Vehicle Speed signal too high", NULL}, {0x02, 221, "CI-221: Vehicle speed signal missing [bad ABS module solders?]", NULL}, {0x03, 114, "CI-114: Fuel Level sensor stuck", NULL}, @@ -462,7 +463,7 @@ static const struct dtc_table_entry dtc_list_51[] = { {0x78, 452, "ROP-452: Control Module, handling fault during Self Test", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_62[] = { +const struct dtc_table_entry dtc_list_62[] = { {0x10, 112, "RTI-112: Control Module, Internal Fault Memory circuits", NULL}, {0x20, 113, "RTI-113: Control Module, Internal Fault, Internal comms", NULL}, {0x30, 114, "RTI-114: Control Module, Internal Fault, Display screen comms", NULL}, @@ -476,7 +477,7 @@ static const struct dtc_table_entry dtc_list_62[] = { {0x70, 141, "RTI-141: TMC/FM receiver, faulty signal", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_6e[] = { +const struct dtc_table_entry dtc_list_6e[] = { {0x02, 122, "AT-122: Shift Solenoid S1 circuit, open [eg, bad wiring or solenoid, or low/dirty fluid]", NULL}, {0x03, 121, "AT-121: Shift Solenoid S1 circuit, short to ground [eg, bad wiring, solenoid, or TCM (ie, ECU 6E), or low/dirty fluid]", NULL}, {0x08, 222, "AT-222: Shift solenoid S2 circuit", NULL}, @@ -520,7 +521,7 @@ static const struct dtc_table_entry dtc_list_6e[] = { {0xE0, 527, "AT-527: Control Module Communication", NULL}, {0, 0, NULL, NULL}, }; -static const struct dtc_table_entry dtc_list_7a[] = { +const struct dtc_table_entry dtc_list_7a[] = { {0x0A, 422, "EFI-422: Atmospheric pressure sensor signal", NULL}, {0x0F, 122, "EFI-122: Intake Air Temperature (IAT) Sensor Faulty", NULL}, {0x12, 414, "EFI-414: Boost pressure regulation", NULL}, @@ -665,7 +666,7 @@ static const struct dtc_table_entry dtc_list_7a[] = { {0x1D, 666, "EFI-666: DTC in transmission CM", NULL}, {0, 0, NULL, NULL}, }; -static struct ecu_info ecu_list[] = { +const struct ecu_info ecu_list[] = { { .addr = 0x01, .desc = "ABS", .dtc_prefix = "ABS" }, { .addr = 0x02, .desc = "DSA", .dtc_prefix = "DSA" }, { .addr = 0x11, .desc = "MSA15.7", .dtc_prefix = "EFI" }, @@ -685,7 +686,7 @@ static struct ecu_info ecu_list[] = { {0, NULL, NULL, NULL} }; -static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { +const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {0x01, dtc_list_01}, {0x02, dtc_list_02}, {0x11, dtc_list_11}, @@ -702,4 +703,4 @@ static const struct ecu_dtc_table_map_entry ecu_dtc_map[] = { {0, NULL}, }; -#endif // __SCANTOOL_850_DTC_XIAOTEC_H__ +#endif // __SCANTOOL_850_DTC_XIAOTEC__