collectTo

open fun <T> Flow<T>.collectTo(scope: CoroutineScope, started: SharingStarted, replay: Int = 0, notification: LocalCharacteristic.DSL.NotificationDSL<T>.() -> Unit)

Collects a Flow of T and notifies any subscribed com.splendo.kaluga.bluetooth.ConnectedDevice of any changes. Results in a call to notifiable that may only be called once

Parameters

scope

the CoroutineScope to use to collect the Flow

started

the SharingStarted to use to collect the Flow

replay

the number of values to replay to new subscribers

notification

the NotificationDSL to use to set up notification

Type Parameters

T

the type of the data being collected


open fun <T> SharedFlow<T>.collectTo(scope: CoroutineScope, notification: LocalCharacteristic.DSL.NotificationDSL<T>.() -> Unit)

Collects a SharedFlow of T and notifies any subscribed com.splendo.kaluga.bluetooth.ConnectedDevice of any changes. Results in a call to notifiable that may only be called once

Parameters

scope

the CoroutineScope to use to collect the Flow

notification

the NotificationDSL to use to set up notification

Type Parameters

T

the type of the data being collected


open fun <T> StateFlow<T>.collectTo(scope: CoroutineScope, notification: LocalCharacteristic.DSL.NotificationDSL<T>.() -> Unit)

Collects a StateFlow of T and notifies any subscribed com.splendo.kaluga.bluetooth.ConnectedDevice of any changes. Results in a call to notifiable that may only be called once

Parameters

scope

the CoroutineScope to use to collect the Flow

notification

the NotificationDSL to use to set up notification

Type Parameters

T

the type of the data being collected