refactor: implement repository pattern replacement for AIDL methods

This commit is contained in:
andrekir 2024-11-21 20:30:25 -03:00
parent f73d909cd0
commit 80f8f2a591
4 changed files with 45 additions and 0 deletions

View file

@ -16,6 +16,7 @@ import com.geeksville.mesh.deviceProfile
import com.geeksville.mesh.model.NodeDB
import com.geeksville.mesh.model.getChannelUrl
import com.geeksville.mesh.service.MeshService.ConnectionState
import com.geeksville.mesh.service.ServiceAction
import com.geeksville.mesh.service.ServiceRepository
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
@ -177,6 +178,12 @@ class RadioConfigRepository @Inject constructor(
serviceRepository.emitMeshPacket(packet)
}
val serviceAction: SharedFlow<ServiceAction> get() = serviceRepository.serviceAction
suspend fun onServiceAction(action: ServiceAction) = coroutineScope {
serviceRepository.onServiceAction(action)
}
val tracerouteResponse: StateFlow<String?> get() = serviceRepository.tracerouteResponse
fun setTracerouteResponse(value: String?) {