MockConnectableDeviceStateRepo

Constructors

Link copied to clipboard
constructor(mockConnectableDeviceManager: MockConnectableDeviceManager, coroutineContext: CoroutineContext)

Properties

Link copied to clipboard
Link copied to clipboard
open override val lazyMutableSharedFlow: Lazy<MutableStateFlow<ConnectableDeviceState>>
Link copied to clipboard
open override val stateFlow: StateFlow<ConnectableDeviceState>
Link copied to clipboard
val subscriptionCount: StateFlow<Int>

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<ConnectableDeviceState>): Nothing
Link copied to clipboard
suspend fun CoroutineScope.connectedMockClient(builder: ServiceWrapperBuilder.() -> Unit): ConnectedMockClient

Connects a mock Bluetooth device exposing the service described by builder, discovers its services, and returns a ConnectedMockClient that keeps the device connected so reads and writes route end-to-end.

Link copied to clipboard
suspend override fun initialValue(): ConnectableDeviceState
Link copied to clipboard
fun launchTakeAndChangeState(context: CoroutineContext, action: suspend (ConnectableDeviceState) -> suspend () -> ConnectableDeviceState): Job
fun <K : ConnectableDeviceState> launchTakeAndChangeState(context: CoroutineContext, remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> ConnectableDeviceState): Job
Link copied to clipboard
fun <Result> launchUseState(context: CoroutineContext, action: suspend (ConnectableDeviceState) -> Result): Job
Link copied to clipboard
Link copied to clipboard
suspend fun <K : ConnectableDeviceState> takeAndChangeState(remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> ConnectableDeviceState): ConnectableDeviceState
Link copied to clipboard
suspend fun <Result> useState(action: suspend (ConnectableDeviceState) -> Result): Result