Move RileyLink components to a separate dependency injection module

Having them in the Medtronic module will only create confusion later on.
This commit is contained in:
Steffen Müthing 2020-08-17 00:10:37 +02:00
parent 69da89b19b
commit 7d52228e15
3 changed files with 31 additions and 21 deletions

View file

@ -26,6 +26,7 @@ import javax.inject.Singleton
CommandQueueModule::class,
ObjectivesModule::class,
WizardModule::class,
RileyLinkModule::class,
MedtronicModule::class,
OmnipodModule::class,
APSModule::class,

View file

@ -2,33 +2,12 @@ package info.nightscout.androidaps.dependencyInjection
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.*
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask
@Module
@Suppress("unused")
abstract class MedtronicModule {
@ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): RileyLinkCommunicationManager
@ContributesAndroidInjector abstract fun medtronicCommunicationManagerProvider(): MedtronicCommunicationManager
@ContributesAndroidInjector abstract fun medtronicUITaskProvider(): MedtronicUITask
@ContributesAndroidInjector abstract fun serviceTaskProvider(): ServiceTask
@ContributesAndroidInjector abstract fun pumpTaskProvider(): PumpTask
@ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): DiscoverGattServicesTask
@ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): InitializePumpManagerTask
@ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): ResetRileyLinkConfigurationTask
@ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): WakeAndTuneTask
@ContributesAndroidInjector abstract fun radioResponseProvider(): RadioResponse
@ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): RileyLinkBLE
@ContributesAndroidInjector abstract fun rfSpyProvider(): RFSpy
@ContributesAndroidInjector abstract fun sendAndListenProvider(): SendAndListen
@ContributesAndroidInjector abstract fun setPreambleProvider(): SetPreamble
@ContributesAndroidInjector abstract fun radioPacketProvider(): RadioPacket
}

View file

@ -0,0 +1,30 @@
package info.nightscout.androidaps.dependencyInjection
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SendAndListen
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.command.SetPreamble
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.*
@Module
@Suppress("unused")
abstract class RileyLinkModule {
@ContributesAndroidInjector abstract fun rileyLinkCommunicationManagerProvider(): RileyLinkCommunicationManager
@ContributesAndroidInjector abstract fun serviceTaskProvider(): ServiceTask
@ContributesAndroidInjector abstract fun pumpTaskProvider(): PumpTask
@ContributesAndroidInjector abstract fun discoverGattServicesTaskProvider(): DiscoverGattServicesTask
@ContributesAndroidInjector abstract fun initializePumpManagerTaskProvider(): InitializePumpManagerTask
@ContributesAndroidInjector abstract fun resetRileyLinkConfigurationTaskProvider(): ResetRileyLinkConfigurationTask
@ContributesAndroidInjector abstract fun wakeAndTuneTaskProvider(): WakeAndTuneTask
@ContributesAndroidInjector abstract fun radioResponseProvider(): RadioResponse
@ContributesAndroidInjector abstract fun rileyLinkBLEProvider(): RileyLinkBLE
@ContributesAndroidInjector abstract fun rfSpyProvider(): RFSpy
@ContributesAndroidInjector abstract fun sendAndListenProvider(): SendAndListen
@ContributesAndroidInjector abstract fun setPreambleProvider(): SetPreamble
@ContributesAndroidInjector abstract fun radioPacketProvider(): RadioPacket
}