Package-level declarations

Types

Link copied to clipboard
enum class AdminRoute : Enum<AdminRoute>
Link copied to clipboard
class CleanNodeDatabaseViewModel(cleanNodeDatabaseUseCase: CleanNodeDatabaseUseCase, alertManager: AlertManager) : ViewModel

ViewModel for CleanNodeDatabaseScreen. Manages the state and logic for cleaning the node database based on specified criteria. The "older than X days" filter is always active.

Link copied to clipboard
class DatabaseBackupActions(val available: Boolean, val onBackup: () -> Unit, val onRestore: () -> Unit)

Picker-backed entry points for the Backup & Restore section's app database items. available is false until some device has a database.

Link copied to clipboard
class DatabaseBackupViewModel(backupService: DatabaseBackupOperations, fileService: FileService, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, alertManager: AlertManager) : ViewModel

Backs up the app database for the connected device, and stages a restore that applies on the next launch.

Link copied to clipboard
class DeviceProfileTransfer(val onImport: () -> Unit, val onExport: () -> Unit)

The Import and Export configuration actions, backed by the platform's file pickers.

Link copied to clipboard
data class RadioConfigState(val isLocal: Boolean = false, val pioEnv: String? = null, val connected: Boolean = false, val route: String = "", val metadata: DeviceMetadata? = null, val userConfig: User = User.Builder().build(), val channelList: List<ChannelSettings> = emptyList(), val radioConfig: LocalConfig = LocalConfig.Builder().build(), val moduleConfig: LocalModuleConfig = LocalModuleConfig.Builder().build(), val ringtone: String = "", val cannedMessageMessages: String = "", val deviceConnectionStatus: DeviceConnectionStatus? = null, val deviceUIConfig: DeviceUIConfig? = null, val fileManifest: List<FileInfo> = emptyList(), val loraRegionPresetMap: LoRaRegionPresetMap? = null, val localIsLicensed: Boolean = false, val responseState: ResponseState<Boolean> = ResponseState.Empty, val analyticsAvailable: Boolean = true, val analyticsEnabled: Boolean = true, val nodeDbResetPreserveFavorites: Boolean = false, val canRebootToDfu: Boolean = false, val isOemFixedGps: Boolean = false)

Data class that represents the current RadioConfig state.

Link copied to clipboard
open class RadioConfigViewModel(@Assisted initialDestNum: Int?, radioConfigRepository: RadioConfigRepository, serviceRepository: ServiceRepository, nodeRepository: NodeRepository, deviceHardwareRepository: DeviceHardwareRepository, locationRepository: LocationRepository, mapConsentPrefs: MapConsentPrefs, analyticsPrefs: AnalyticsPrefs, homoglyphEncodingPrefs: HomoglyphPrefs, importProfileUseCase: ImportProfileUseCase, exportProfileUseCase: ExportProfileUseCase, importSecurityConfigUseCase: ImportSecurityConfigUseCase, installProfileUseCase: InstallProfileUseCase, adminController: AdminController, adminActionsUseCase: AdminActionsUseCase, locationService: LocationService, fileService: FileService, mqttManager: MqttManager, lockdownCoordinator: LockdownCoordinator, securityKeyBackupStore: SecurityKeyBackupStore, snackbarManager: SnackbarManager, nodeRestartTracker: NodeRestartTracker, analytics: PlatformAnalytics, nodeManager: NodeManager, meshBeaconRepository: MeshBeaconRepository, hiddenFeaturesUnlock: HiddenFeaturesUnlock) : ViewModel
Link copied to clipboard

How the firmware applies a saved config section (firmware AdminModule::handleSetConfig / handleSetModuleConfig): most sections are applied with a node reboot a few seconds after the save is acked.

Link copied to clipboard

A write this screen sends to the remote node's node DB.

Link copied to clipboard
class RemoteContactsViewModel(@Assisted val destNum: Int, nodeRepository: NodeRepository, radioController: RadioController, ensureRemoteAdminSession: EnsureRemoteAdminSessionUseCase) : ViewModel

Edits the node DB of destNum, a node this radio administers remotely: send a contact and favorite it, unfavorite, ignore, unignore and remove. Candidates come from the local node DB, since firmware has no admin request that lists a remote node DB.

Link copied to clipboard
data class RemoteWriteResult(val nodeNum: Int?, val action: RemoteContactAction, val status: RemoteWriteStatus)

The latest write and how it went. nodeNum is null for a contact pasted as a URL.

Link copied to clipboard
Link copied to clipboard
sealed class ResponseState<out T>

Generic sealed class defines each possible state of a response.

Link copied to clipboard
data class SecurityKeyBackupOption(val nodeNum: Int, val longName: String?, val timestamp: Long, val isCurrentNode: Boolean)

One stored key backup offered for restore; longName is null when the node DB no longer knows nodeNum.

Functions

Link copied to clipboard

Composable screen for cleaning the node database. Allows users to specify criteria for deleting nodes. The list of nodes to be deleted updates automatically as filter criteria change.

Link copied to clipboard
fun RadioConfigItemList(state: RadioConfigState, isManaged: Boolean, connectionIdentity: ConnectionIdentity?, isOtaCapable: Boolean = false, onRouteClick: (Enum<*>) -> Unit = {}, onImport: () -> Unit = {}, onExport: () -> Unit = {}, databaseBackupAvailable: Boolean = true, onBackupDatabase: () -> Unit = {}, onRestoreDatabase: () -> Unit = {}, destNum: Int? = null, onNavigate: (Route) -> Unit)
Link copied to clipboard

Import reads a profile file and offers it in the edit dialog before installing it; export offers the current profile in that dialog and then asks where to save it. Hosts the dialog, so it must stay in composition while in use.