3.1.8.2.20. waf_tools.bms_config_generate.CreateFoxbmsConfig
- class waf_tools.bms_config_generate.CreateFoxbmsConfig(*k, **kw)
Bases:
TaskWaf task that generates a foxBMS configuration header file.
For each configured content domain (e.g.
"rtos","current_sensor"), this task invokes the corresponding function fromCONFIG_FUNCTIONSto collect#defineentries, then renders them into a C header file with an include guard.- system
The validated
waf_tools.bms_config_model.Systeminstance providing all configuration values.- Type:
- content
List of configuration domain keys to include in this header (e.g.,
["rtos"],["current_sensor"]).- Type:
list[str]
- generate_header(defines: list[dict]) str
Render a list of define dictionaries into a complete C header string.
Produces a header with an include guard derived from the output file name and one
#definedirective per entry.- Parameters:
defines – List of dictionaries, each containing
"name"and"value"keys representing a single preprocessor define.- Returns:
The full header file content as a string.
- run() None
Generate the configuration header from the defined content.
Iterates over
content, calls the matching function fromCONFIG_FUNCTIONSfor each entry, collects all resulting define dictionaries, and writes the rendered header to the output node.Raises
WafErrorif an unknown content key is encountered.