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, radioOperationLock: RadioOperationLock, applicationScope: ApplicationCoroutineScope, hiddenFeaturesUnlock: HiddenFeaturesUnlock, analytics: PlatformAnalytics, nodeRestartTracker: NodeRestartTracker, bluetoothRepository: BluetoothRepository, firmwareUpdateStatusRepository: FirmwareUpdateStatusRepository) : 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, radioOperationLock: RadioOperationLock, applicationScope: ApplicationCoroutineScope, hiddenFeaturesUnlock: HiddenFeaturesUnlock, analytics: PlatformAnalytics, nodeRestartTracker: NodeRestartTracker, bluetoothRepository: BluetoothRepository, firmwareUpdateStatusRepository: FirmwareUpdateStatusRepository)

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

Writes the reviewed bootloader upgrade to the drive the review read.

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

Moves on to reinstalling the firmware without writing the bootloader, so nothing destructive has happened.

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.