20#include "sensorring/platform/SensorringExport.hpp"
24namespace firmware_update {
104 bool flashSingleBoardImpl(
const com::ComInterfaceID& interface, std::uint8_t node_id,
const std::string& hex_file_path,
const std::string& display_node_label,
LogCallback log_callback)
const;
Interface type definition.
std::function< void(const std::string &)> LogCallback
Callback invoked by the updater to emit human-readable log messages.
Definition FirmwareUpdater.hpp:40
bool 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.
FirmwareUpdater(UpdateConfig config={})
Constructs a FirmwareUpdater with the given timing/retry configuration.
bool 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.
std::optional< std::uint8_t > detectBootloaderNode(const com::ComInterfaceID &interface) const
Detects whether any board on the ring is currently in bootloader mode.
bool enterSingleBoardBootloader(const com::ComInterfaceID &interface, std::size_t board_index, LogCallback log_callback={}) const
Requests a single board to enter bootloader mode.
std::optional< std::uint8_t > detectBootloaderNodeWithRetries(const com::ComInterfaceID &interface)
Detects whether any board on the ring is currently in bootloader mode, with retries....
Uniquely identifies a communication interface by type and name.
Definition ComInterfaceID.hpp:51
Timing and retry parameters that control the firmware-update procedure.
Definition FirmwareUpdater.hpp:30
unsigned int no_progress_cycles_before_done
Number of consecutive cycles without progress that signal a completed flash operation.
Definition FirmwareUpdater.hpp:36
std::chrono::milliseconds bootloader_detect_retry_delay
Pause between consecutive bootloader-detection attempts.
Definition FirmwareUpdater.hpp:34
unsigned int bootloader_detect_retries
Number of bootloader-detection attempts before giving up.
Definition FirmwareUpdater.hpp:35
std::chrono::milliseconds bootloader_start_ack_timeout
Maximum time to wait for the bootloader-start acknowledgement after a reset.
Definition FirmwareUpdater.hpp:32
std::chrono::milliseconds can_timeout
Maximum time to wait for a CAN response before declaring a timeout.
Definition FirmwareUpdater.hpp:31
std::chrono::milliseconds settle_delay_after_flash
Delay inserted after the last flash packet to let the board settle before verification.
Definition FirmwareUpdater.hpp:33