mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-20 07:54:20 +01:00
Single instance of CentralManagerModule
This commit is contained in:
@@ -9,12 +9,14 @@ import dagger.hilt.components.SingletonComponent
|
|||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import no.nordicsemi.kotlin.ble.client.android.CentralManager
|
import no.nordicsemi.kotlin.ble.client.android.CentralManager
|
||||||
import no.nordicsemi.kotlin.ble.client.android.native
|
import no.nordicsemi.kotlin.ble.client.android.native
|
||||||
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@InstallIn(SingletonComponent::class)
|
@InstallIn(SingletonComponent::class)
|
||||||
object CentralManagerModule {
|
object CentralManagerModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
@Singleton
|
||||||
fun provideCentralManager(
|
fun provideCentralManager(
|
||||||
@ApplicationContext context: Context,
|
@ApplicationContext context: Context,
|
||||||
scope: CoroutineScope
|
scope: CoroutineScope
|
||||||
|
|||||||
Reference in New Issue
Block a user