Flashes sensor-board firmware images over a CAN interface.
More...
#include <FirmwareUpdater.hpp>
Flashes sensor-board firmware images over a CAN interface.
FirmwareUpdater uses the frankly bootloader protocol to transfer Intel HEX firmware images to one or more sensor boards connected on a CAN bus. All operations are synchronous and blocking; call them from a dedicated thread if you need to keep the rest of the application responsive.
◆ FirmwareUpdater()
| eduart::sensorring::firmware_update::FirmwareUpdater::FirmwareUpdater |
( |
UpdateConfig | config = {} | ) |
|
|
explicit |
Constructs a FirmwareUpdater with the given timing/retry configuration.
- Parameters
-
| config | Timing and retry parameters. Defaults to UpdateConfig{}. |
◆ detectBootloaderNode()
| std::optional< std::uint8_t > eduart::sensorring::firmware_update::FirmwareUpdater::detectBootloaderNode |
( |
const com::ComInterfaceID & | interface | ) |
const |
Detects whether any board on the ring is currently in bootloader mode.
- Parameters
-
| interface | Communication interface to scan. |
- Returns
- The CAN node ID of the board in bootloader mode, or
std::nullopt if none was found.
◆ detectBootloaderNodeWithRetries()
| std::optional< std::uint8_t > eduart::sensorring::firmware_update::FirmwareUpdater::detectBootloaderNodeWithRetries |
( |
const com::ComInterfaceID & | interface | ) |
|
Detects whether any board on the ring is currently in bootloader mode, with retries. Number of retries and delay between retries are configurable via UpdateConfig.
- Parameters
-
| interface | Communication interface to scan. |
- Returns
- The CAN node ID of the board in bootloader mode, or
std::nullopt if none was found.
◆ enterSingleBoardBootloader()
| bool eduart::sensorring::firmware_update::FirmwareUpdater::enterSingleBoardBootloader |
( |
const com::ComInterfaceID & | interface, |
|
|
std::size_t | board_index, |
|
|
LogCallback | log_callback = {} ) const |
Requests a single board to enter bootloader mode.
- Parameters
-
| interface | Communication interface to use. |
| board_index | Zero-based index of the board on the ring that should enter bootloader mode. |
| log_callback | Optional callback that receives status messages. |
- Returns
true if the board acknowledged the bootloader-enter request, false otherwise.
◆ flashAllBoardsSequential()
| bool eduart::sensorring::firmware_update::FirmwareUpdater::flashAllBoardsSequential |
( |
const com::ComInterfaceID & | interface, |
|
|
const std::string & | hex_file_path, |
|
|
LogCallback | log_callback = {} ) const |
Flashes every board on the ring sequentially with the same firmware image.
- Parameters
-
| interface | Communication interface to use. |
| hex_file_path | Path to the Intel HEX file that contains the firmware image. |
| log_callback | Optional callback that receives per-board progress messages. |
- Returns
true if every board was flashed successfully, false if any board failed.
◆ flashSingleBoard()
| bool eduart::sensorring::firmware_update::FirmwareUpdater::flashSingleBoard |
( |
const com::ComInterfaceID & | interface, |
|
|
std::uint8_t | node_id, |
|
|
const std::string & | hex_file_path, |
|
|
LogCallback | log_callback = {} ) const |
Flashes a single board identified by its CAN node ID.
- Parameters
-
| interface | Communication interface to use for the update. |
| node_id | CAN node ID of the target board. |
| hex_file_path | Path to the Intel HEX file that contains the firmware image. |
| log_callback | Optional callback that receives progress and status messages. |
- Returns
true if the board was flashed successfully, false otherwise.
The documentation for this class was generated from the following file: