Package-level declarations

Types

Link copied to clipboard
class AndroidFirmwareFileHandler(context: Context, client: HttpClient) : BaseFirmwareFileHandler

Helper class to handle file operations related to firmware updates, such as downloading, copying from URI, and extracting specific files from Zip archives.

Link copied to clipboard

Manages USB-related interactions for firmware updates.

Link copied to clipboard
abstract class BaseFirmwareFileHandler(client: HttpClient, tempDir: File) : FirmwareFileHandler

The FirmwareFileHandler work the Android and desktop handlers share: HTTP fetches into tempDir, and firmware extraction through the bounded extractFirmwareEntry. Subclasses say how a platform URI is opened.

Link copied to clipboard
data class BootloaderDfuZip(val url: String, val fileName: String, val sha256: String, val version: String, val softDevice: SoftDeviceVariant, val bleModel: String)

A pinned legacy DFU SoftDevice+bootloader package for one board, and what its bootloader must report over DIS before it is written.

Link copied to clipboard
data class BootloaderFault(val id: Long, val pc: Long, val info: Long)

A SoftDevice or SDK fault the nRF52 bootloader recorded, from the Last-Fault: line of its INFO_UF2.TXT.

Link copied to clipboard
data class BootloaderStatus(val installed: InstalledBootloader, val latest: KotlinVersion?)

Installed bootloader against the latest release, or no comparison when the latest tag is not plain x.y.z.

Link copied to clipboard
data class BootloaderVersions(val installed: String?, val available: String)

The bootloader a mounted drive reports next to the one the upgrade would install.

Link copied to clipboard

Feature-local seam over core:datastore's BootloaderWarningDataSource, which is Preferences-backed and has no wasmJs variant: the radios whose bootloader warning the user dismissed.

Link copied to clipboard

Delegates to the Preferences-backed BootloaderWarningDataSource.

Link copied to clipboard
class DefaultFirmwareUpdateManager(radioPrefs: RadioPrefs, secureDfuHandler: SecureDfuHandler, usbUpdateHandler: UsbUpdateHandler, esp32OtaUpdateHandler: Esp32OtaUpdateHandler, imageObtainer: FirmwareImageObtainer, radioOperationLock: RadioOperationLock) : FirmwareUpdateManager

Default FirmwareUpdateManager that routes to the correct handler based on the current connection type and device architecture. All handlers are KMP-ready and work on Android, Desktop, and (future) iOS.

Link copied to clipboard
data class FirmwareArtifact(val uri: CommonUri, val fileName: String? = null, val isTemporary: Boolean = false)

Platform-neutral handle for a firmware file or extracted artifact.

Link copied to clipboard

Abstraction over platform file and network I/O required by the firmware update pipeline. Implementations live in androidMain and jvmMain.

Link copied to clipboard
class FirmwareImageObtainer(firmwareRetriever: FirmwareRetriever, firmwareFileHandler: FirmwareFileHandler)

Downloads or imports a firmware image and unpacks it for the BLE update handlers, reporting progress and failures through the same states the handlers used to. ObtainedImage.artifact is the caller's to delete once the update ends.

Link copied to clipboard

Feature-local seam over core:datastore's FirmwareRecoveryDataSource, likewise Preferences-backed: the record of an interrupted BLE update that may have stranded a radio in its bootloader.

Link copied to clipboard

Delegates to the Preferences-backed FirmwareRecoveryDataSource.

Link copied to clipboard
open class FirmwareRetriever(fileHandler: FirmwareFileHandler)

Retrieves firmware files, either by direct download or by extracting from a release asset zip.

Link copied to clipboard
data class FirmwareUpdateActions(val onReleaseTypeSelect: (FirmwareReleaseType) -> Unit, val onStartUpdate: (Boolean) -> Unit, val onPickFile: () -> Unit, val onSaveFile: (String) -> Unit, val onPickVolume: () -> Unit, val onBootloaderUpgrade: () -> Unit, val onBleBootloaderUpgrade: () -> Unit, val onConfirmBootloaderUpgrade: () -> Unit, val onSkipBootloaderUpgrade: () -> Unit, val onConfirmLocalFile: () -> Unit, val onDismissLocalFile: () -> Unit, val onRetry: () -> Unit, val onRetryVerification: () -> Unit, val onCancel: () -> Unit, val onPlayChirpyHop: () -> Unit, val onDone: () -> Unit, val onDismissBootloaderWarning: () -> Unit)
Link copied to clipboard

Common interface for all firmware update handlers (BLE DFU, ESP32 OTA, USB).

Link copied to clipboard

Routes firmware update requests to the appropriate platform-specific handler based on the active connection type (BLE, WiFi/TCP, or USB) and device architecture.

Link copied to clipboard

The transport mechanism used to deliver firmware to the device, determined by the active radio connection.

Link copied to clipboard
sealed interface FirmwareUpdateState

State machine for the firmware update flow, observed by FirmwareUpdateScreen.

Link copied to clipboard
class FirmwareUpdateViewModel(firmwareReleaseRepository: FirmwareReleaseRepository, deviceHardwareRepository: DeviceHardwareRepository, maintenanceUf2Repository: MaintenanceUf2Repository, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, bootloaderWarningDataSource: BootloaderWarningSource, firmwareRecoveryDataSource: FirmwareRecoverySource, firmwareUpdateManager: FirmwareUpdateManager, usbManager: FirmwareUsbManager, fileHandler: FirmwareFileHandler, firmwareRetriever: FirmwareRetriever, radioOperationLock: RadioOperationLock, applicationScope: ApplicationCoroutineScope, analytics: PlatformAnalytics, nodeRestartTracker: NodeRestartTracker, bluetoothRepository: BluetoothRepository, firmwareUpdateStatusRepository: FirmwareUpdateStatusRepository, uiPrefs: UiPrefs) : ViewModel

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

Link copied to clipboard
Link copied to clipboard
sealed interface InstalledBootloader

The bootloader a running nRF52 device reports in DeviceMetadata.bootloader_version.

Link copied to clipboard
Link copied to clipboard

The FirmwareUsbManager of a host with no maintenance affordance at all, desktop and the browser: with no way to vet a bootloader volume and no CDC unblock, every maintenance operation below is a no-op, so the section is hidden rather than shown and then dead-ended. ensureSerialPermission is the exception: neither host has a USB permission model to preflight, so it succeeds trivially.

Link copied to clipboard
data class PendingLocalFirmwareFile(val uri: CommonUri, val fileName: String, val deviceName: String, val platformioTarget: String, val updateMethod: FirmwareUpdateMethod, val address: String)
Link copied to clipboard
data class ProgressState(val message: UiText = UiText.DynamicString(""), val progress: Float = 0.0f, val details: UiText? = null, val hint: UiText? = null)

Represents the progress of a long-running firmware update task.

Link copied to clipboard
class RadioMeshLink(radioController: RadioController, nodeRepository: NodeRepository) : MeshLink

MeshLink over the app's radio connection.

Link copied to clipboard

Which leg of a multi-pass USB/UF2 sequence a file-save prompt belongs to.

Link copied to clipboard
data class UsbMaintenanceGate(val show: Boolean = false, val eraseRefusal: UsbMaintenanceRefusal? = null, val showBootloaderUpgrade: Boolean = false, val latestBootloader: String? = null)

Which maintenance affordances the Ready state should show, precomputed by the ViewModel.

Link copied to clipboard

Why a maintenance action cannot run. Surfaced as explanatory copy rather than silently hiding the action.

Link copied to clipboard

A maintenance operation the user can start from the Ready state.

Link copied to clipboard
class UsbUpdateHandler(firmwareRetriever: FirmwareRetriever, radioController: RadioController, nodeRepository: NodeRepository) : FirmwareUpdateHandler

Handles firmware updates via USB Mass Storage (UF2).

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun FirmwareUpdateScreen(onNavigateUp: () -> Unit, viewModel: FirmwareUpdateViewModel, modifier: Modifier = Modifier)
Link copied to clipboard
Link copied to clipboard