3.1.19.2.2. waf_tools.diag_array_config_validate.validate_diag_array_configuration

waf_tools.diag_array_config_validate.validate_diag_array_configuration(bld: BuildContext, diag_array_json: Node) → DiagArrayConfiguration

Validate the diagnostic array configuration file.

Reads the JSON configuration, parses it into a typed DiagArrayConfiguration, and cross-checks the configured events against the DIAG_ID_e enumeration in diag_cfg.h as well as the FatalErrorCode signal choices in foxbms.dbc.

This function shall be called in the build phase and is intended to be passed as the validator callback to the codegen_config waf feature. The raised error is reported by waf_tools.config_codegen_task.CreateCfgFile, which then fails the task.

Parameters:
  • bld – The active waf build context.

  • diag_array_json – Node pointing to the diag_array_cfg.json configuration file.

Returns:

Validated diagnostic array configuration.

Return type:

DiagArrayConfiguration

Raises:
  • InvalidDiagConfigurationError – If diag_cfg.h or the DBC file cannot be found, the configuration is invalid, or it is inconsistent with diag_cfg.h or the DBC file.

  • ValueError – If the number of configured events differs the number of DIAG_ID_e enumerators.