refactor: Client Notification Support (#2095)

This commit is contained in:
James Rich 2025-06-13 01:00:28 +00:00 committed by GitHub
parent 2a274e259b
commit 606d1520d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 101 additions and 1 deletions

View file

@ -25,6 +25,7 @@ import com.geeksville.mesh.ConfigProtos.Config
import com.geeksville.mesh.IMeshService
import com.geeksville.mesh.LocalOnlyProtos.LocalConfig
import com.geeksville.mesh.LocalOnlyProtos.LocalModuleConfig
import com.geeksville.mesh.MeshProtos
import com.geeksville.mesh.MeshProtos.DeviceMetadata
import com.geeksville.mesh.MeshProtos.MeshPacket
import com.geeksville.mesh.ModuleConfigProtos.ModuleConfig
@ -85,6 +86,7 @@ class RadioConfigRepository @Inject constructor(
suspend fun installNodeDB(mi: MyNodeEntity, nodes: List<NodeEntity>) {
nodeDB.installNodeDB(mi, nodes)
}
suspend fun insertMetadata(fromNum: Int, metadata: DeviceMetadata) {
nodeDB.insertMetadata(MetadataEntity(fromNum, metadata))
}
@ -187,6 +189,16 @@ class RadioConfigRepository @Inject constructor(
}
}
val clientNotification = serviceRepository.clientNotification
fun setClientNotification(notification: MeshProtos.ClientNotification?) {
serviceRepository.setClientNotification(notification)
}
fun clearClientNotification() {
serviceRepository.clearClientNotification()
}
val errorMessage: StateFlow<String?> get() = serviceRepository.errorMessage
fun setErrorMessage(text: String) {