kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Mesh service needs to collect on Flow instances
rodzic
0acf037000
commit
7cd1e7fc96
|
@ -39,7 +39,6 @@ import com.google.protobuf.InvalidProtocolBufferException
|
||||||
import dagger.Lazy
|
import dagger.Lazy
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.flow.onEach
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -326,14 +325,17 @@ class MeshService : Service(), Logging {
|
||||||
serviceScope.handledLaunch {
|
serviceScope.handledLaunch {
|
||||||
loadSettings() // Load our last known node DB
|
loadSettings() // Load our last known node DB
|
||||||
|
|
||||||
radioInterfaceService.receivedData.onEach(::onReceiveFromRadio)
|
|
||||||
radioInterfaceService.connectionState.onEach(::onRadioConnectionState)
|
|
||||||
|
|
||||||
// We in turn need to use the radiointerface service
|
// We in turn need to use the radiointerface service
|
||||||
radioInterfaceService.connect()
|
radioInterfaceService.connect()
|
||||||
|
|
||||||
// the rest of our init will happen once we are in radioConnection.onServiceConnected
|
|
||||||
}
|
}
|
||||||
|
serviceScope.handledLaunch {
|
||||||
|
radioInterfaceService.connectionState.collect(::onRadioConnectionState)
|
||||||
|
}
|
||||||
|
serviceScope.handledLaunch {
|
||||||
|
radioInterfaceService.receivedData.collect(::onReceiveFromRadio)
|
||||||
|
}
|
||||||
|
|
||||||
|
// the rest of our init will happen once we are in radioConnection.onServiceConnected
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Ładowanie…
Reference in New Issue