5.3.1.3.4.1. cli.cmd_bootloader.bootloader_can.BootloaderInterfaceCan

class cli.cmd_bootloader.bootloader_can.BootloaderInterfaceCan(can_bus: BusABC, app_dbc: Path = WindowsPath('D:/_github/foxbms-2/tools/dbc/foxbms.dbc'), bootloader_dbc: Path = WindowsPath('D:/_github/foxbms-2/tools/dbc/foxbms-bootloader.dbc'))

Implement CAN-specific bootloader interface for higher-level operations.

This class provides all CAN-related functions required to interact with the bootloader. It wraps low-level CAN messaging to send commands, wait for and receive specific messages on the CAN bus, and control the transfer and validation of application data.

__init__(can_bus: BusABC, app_dbc: Path = WindowsPath('D:/_github/foxbms-2/tools/dbc/foxbms.dbc'), bootloader_dbc: Path = WindowsPath('D:/_github/foxbms-2/tools/dbc/foxbms-bootloader.dbc')) None

Init function.

Parameters:

can_bus – CAN bus object

Methods

__init__(can_bus[, app_dbc, bootloader_dbc])

Init function.

get_bootloader_state()

Ask bootloader for its current state.

get_bootloader_version_num()

Get the bootloader's version number.

get_current_num_of_loops()

Ask the bootloader to get its current number of data transfer loops.

get_foxbms_state()

Get the current state of foxBMS application if it is running.

reset_bootloader([time_to_wait, num_of_repeat])

Reset bootloader.

run_app_on_bootloader()

Run the BMS application on the BMS-Master (i.e., jump from the bootloader into the application via BMS state request.)

send_crc(crc_8_bytes[, is_crc_of_vector_table])

Send CRC signature to the bootloader and evaluate its acknowledgement.

send_data_to_bootloader(data_8_bytes)

Send data in 8 bytes to bootloader.

send_loop_number_to_bootloader(num_of_loop)

Send the current loop number of the to-be-transferred data to bootloader.

send_program_info(len_of_program_in_bytes, ...)

Send program info to bootloader and check its states.

start_transfer()

Inform bootloader to start the transfer program process.

wait_can_ack_msg(acknowledge_msg[, ...])

Wait for a certain ACK message.