4.8. Diagnosis Module

4.8.1. Module Files

4.8.1.1. Driver

4.8.1.2. Configuration

  • src/app/engine/config/diag_cfg.c (API, source)

  • src/app/engine/config/diag_cfg.h (API, source)

  • src/app/engine/diag/cbs/diag_cbs_can.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_contactor.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_current.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_current-sensor.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_deep-discharge.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_dummy.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_interlock.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_afe.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_plausibility.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_power-measurement.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_sbc.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_sys-mon.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_temperature.c (API, source)

  • src/app/engine/diag/cbs/diag_cbs_voltage.c (API, source)

4.8.1.3. Unit Test

  • tests/unit/app/engine/config/test_diag_cfg.c (API, source)

  • tests/unit/app/engine/diag/test_diag.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_can.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_contactor.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_current.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_current-sensor.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_deep-discharge.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_dummy.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_interlock.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_afe.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_plausibility.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_power-measurement.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_sbc.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_sys-mon.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_temperature.c (API, source)

  • tests/unit/app/engine/diag/cbs/test_diag_cbs_voltage.c (API, source)

4.8.2. Detailed Description

A detailed description on how to use the diagnosis module can be found in How to Use the Diagnosis Module.

The diagnosis module is implemented as a central table DIAG_ID_cfg that maps DIAG_IDs to callbacks. Whenever the diagnosis handler is called in the application code the diagnosis module selects based on this table the appropriate callback. It is in the responsibility of the callback to handle the reported issue.

In most implementations the callback sets according to the reported issue an entry in the database for convenient use of error conditions. An example is the CAN module that reports set error conditions from the relevant tables in the database. These entries are set from the callbacks of the diagnosis module.

In addition to the callbacks, several parameters of the occurring issue can be set. As an example the table configures whether an diagnosis entry has a fatal severity. The diagnosis module makes convenience functions available that allow for scanning for fatal errors in order to react on any of these issues.