mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: Client Notification Support (#2095)
This commit is contained in:
parent
2a274e259b
commit
606d1520d8
5 changed files with 101 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue