5.3.1.24.13. cli.helpers.misc

Miscellaneous helper functions and path definitions for foxBMS utilities.

This module provides helper functions for environment setup, logging configuration, hashing, and path management, as well as constants for important foxBMS file locations.

cli.helpers.misc.PROJECT_ROOT

Path to the root of the project repository or package.

cli.helpers.misc.ROOT_IS_PROJECT

True, when in the foxBMS repository, otherwise False.

cli.helpers.misc.PROJECT_BUILD_ROOT

Path to the project’s build directory.

cli.helpers.misc.PATH_FILE

Path to the platform-specific paths file.

cli.helpers.misc.FOXBMS_ELF_FILE

Path to the foxBMS ELF file.

cli.helpers.misc.FOXBMS_BIN_FILE

Path to the foxBMS binary file.

cli.helpers.misc.FOXBMS_APP_CRC_FILE

Path to the foxBMS CRC CSV file.

cli.helpers.misc.FOXBMS_APP_INFO_FILE

Path to the foxBMS CRC info JSON file.

cli.helpers.misc.APP_DBC_FILE

Path to the application DBC file.

cli.helpers.misc.BOOTLOADER_DBC_FILE

Path to the bootloader DBC file.

Functions

create_pre_commit_file()

Add or update a pre-commit file in the .git/hooks directory.

file_name_from_current_time()

Create a file-system-friendly ISO timestamp as a Path.

get_env()

Check if command is run in the foxBMS repository or the fox CLI package and whether it is valid in this environment.

get_file_path()

Return path to the directory containing project-files if in the package, otherwise return PROJECT_ROOT

get_multiple_files_hash_str(files[, buffer_size])

Return the hexadecimal SHA256 hash string for multiple files.

get_project_root([path])

Find the repository or package root directory.

get_sha256_file_hash(file_path[, ...])

Calculate the SHA256 hash of a file.

get_sha256_file_hash_str(file_path[, ...])

Return the hexadecimal SHA256 hash string of a file.

initialize_path_variable_for_foxbms()

Add expected foxBMS paths to the PATH environment variable.

set_other_environment_variables_for_foxbms()

Set environment variables according to foxBMS specifications.

terminal_link_print(link)

Create a clickable hyperlink string for terminal output.