RadioConfigViewModel

open class RadioConfigViewModel(savedStateHandle: SavedStateHandle, radioConfigRepository: RadioConfigRepository, packetRepository: PacketRepository, serviceRepository: ServiceRepository, nodeRepository: NodeRepository, locationRepository: LocationRepository, mapConsentPrefs: MapConsentPrefs, analyticsPrefs: AnalyticsPrefs, homoglyphEncodingPrefs: HomoglyphPrefs, toggleAnalyticsUseCase: ToggleAnalyticsUseCase, toggleHomoglyphEncodingUseCase: ToggleHomoglyphEncodingUseCase, importProfileUseCase: ImportProfileUseCase, exportProfileUseCase: ExportProfileUseCase, exportSecurityConfigUseCase: ExportSecurityConfigUseCase, installProfileUseCase: InstallProfileUseCase, radioConfigUseCase: RadioConfigUseCase, adminActionsUseCase: AdminActionsUseCase, processRadioResponseUseCase: ProcessRadioResponseUseCase, locationService: LocationService, fileService: FileService, mqttManager: MqttManager) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(savedStateHandle: SavedStateHandle, radioConfigRepository: RadioConfigRepository, packetRepository: PacketRepository, serviceRepository: ServiceRepository, nodeRepository: NodeRepository, locationRepository: LocationRepository, mapConsentPrefs: MapConsentPrefs, analyticsPrefs: AnalyticsPrefs, homoglyphEncodingPrefs: HomoglyphPrefs, toggleAnalyticsUseCase: ToggleAnalyticsUseCase, toggleHomoglyphEncodingUseCase: ToggleHomoglyphEncodingUseCase, importProfileUseCase: ImportProfileUseCase, exportProfileUseCase: ExportProfileUseCase, exportSecurityConfigUseCase: ExportSecurityConfigUseCase, installProfileUseCase: InstallProfileUseCase, radioConfigUseCase: RadioConfigUseCase, adminActionsUseCase: AdminActionsUseCase, processRadioResponseUseCase: ProcessRadioResponseUseCase, locationService: LocationService, fileService: FileService, mqttManager: MqttManager)

Properties

Link copied to clipboard
Link copied to clipboard
val currentDeviceProfile: DeviceProfile
Link copied to clipboard
val destNode: StateFlow<Node?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

MQTT proxy connection state for the settings UI.

Link copied to clipboard

Latest result from a probeMqttConnection call, or null if no probe has been run.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard

Clear the latest probe result (e.g. when the user edits the address).

Link copied to clipboard
Link copied to clipboard
fun exportProfile(uri: CommonUri, profile: DeviceProfile)
Link copied to clipboard
fun exportSecurityConfig(uri: CommonUri, securityConfig: Config.SecurityConfig)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
open suspend fun getCurrentLocation(): Location?
Link copied to clipboard
fun importProfile(uri: CommonUri, onResult: (DeviceProfile) -> Unit)
Link copied to clipboard
fun initDestNum(id: Int?)
Link copied to clipboard
fun installProfile(protobuf: DeviceProfile)
Link copied to clipboard
fun probeMqttConnection(address: String, tlsEnabled: Boolean, username: String?, password: String?)

Run a one-shot reachability/credentials probe against an MQTT broker. Cancels any in-flight probe before starting a new one. Result is exposed via mqttProbeStatus.

Link copied to clipboard
Link copied to clipboard
fun setCannedMessages(messages: String)
Link copied to clipboard
fun setConfig(config: Config)
Link copied to clipboard
fun setFixedPosition(position: Position)
Link copied to clipboard
fun setModuleConfig(config: ModuleConfig)
Link copied to clipboard
fun setOwner(user: User)
Link copied to clipboard
fun setPreserveFavorites(preserveFavorites: Boolean)
Link copied to clipboard
Link copied to clipboard
fun setRingtone(ringtone: String)
Link copied to clipboard
fun setShouldReportLocation(nodeNum: Int?, shouldReportLocation: Boolean)
Link copied to clipboard
fun shouldReportLocation(nodeNum: Int?): StateFlow<Boolean>
Link copied to clipboard
Link copied to clipboard
fun updateChannels(new: List<ChannelSettings>, old: List<ChannelSettings>)