FirmwareUpdateViewModel

class FirmwareUpdateViewModel(firmwareReleaseRepository: FirmwareReleaseRepository, deviceHardwareRepository: DeviceHardwareRepository, maintenanceUf2Repository: MaintenanceUf2Repository, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, bootloaderWarningDataSource: BootloaderWarningDataSource, firmwareRecoveryDataSource: FirmwareRecoveryDataSource, firmwareUpdateManager: FirmwareUpdateManager, usbManager: FirmwareUsbManager, fileHandler: FirmwareFileHandler, firmwareRetriever: FirmwareRetriever, firmwareMaintenanceLock: FirmwareMaintenanceLock, applicationScope: ApplicationCoroutineScope, hiddenFeaturesUnlock: HiddenFeaturesUnlock, analytics: PlatformAnalytics, nodeRestartTracker: NodeRestartTracker) : ViewModel(source)

ViewModel driving the firmware update screen. Coordinates release checking, file retrieval, transport-specific update execution, and post-update device verification.

Constructors

Link copied to clipboard
constructor(firmwareReleaseRepository: FirmwareReleaseRepository, deviceHardwareRepository: DeviceHardwareRepository, maintenanceUf2Repository: MaintenanceUf2Repository, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, bootloaderWarningDataSource: BootloaderWarningDataSource, firmwareRecoveryDataSource: FirmwareRecoveryDataSource, firmwareUpdateManager: FirmwareUpdateManager, usbManager: FirmwareUsbManager, fileHandler: FirmwareFileHandler, firmwareRetriever: FirmwareRetriever, firmwareMaintenanceLock: FirmwareMaintenanceLock, applicationScope: ApplicationCoroutineScope, hiddenFeaturesUnlock: HiddenFeaturesUnlock, analytics: PlatformAnalytics, nodeRestartTracker: NodeRestartTracker)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val nightlyUnlocked: StateFlow<Boolean>

The version-row easter egg also unlocks the nightly preview channel, like the web flasher's konami code.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val state: StateFlow<FirmwareUpdateState>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun startUpdate(wipeDevice: Boolean = false)
Link copied to clipboard

Resumes a maintenance sequence once the user has pointed at the device's UF2 volume.