Package-level declarations

Types

Link copied to clipboard
abstract class BaseScanner(settings: BaseScanner.Settings, coroutineScope: CoroutineScope, scanningDispatcher: CoroutineDispatcher = com.splendo.kaluga.bluetooth.scanner.scanningDispatcher) : Scanner, CoroutineScope

An abstract implementation for Scanner

Link copied to clipboard
abstract class BaseScanningStateRepo(createNotInitializedState: () -> ScanningState.NotInitialized, createInitializingState: suspend ColdStateFlowRepo<ScanningState>.(ScanningState.Inactive) -> suspend () -> ScanningState, createDeinitializingState: suspend ColdStateFlowRepo<ScanningState>.(ScanningState.Active) -> suspend () -> ScanningState.Deinitialized, coroutineContext: CoroutineContext) : ColdStateFlowRepo<ScanningState>

An abstract ColdStateFlowRepo for managing ScanningState

Link copied to clipboard
data class DefaultDevices(val allDevices: Map<Identifier, ConnectableDevice>, val identifiersFoundForDeviceDiscoveryMode: Map<ScanningState.DeviceDiscoveryMode, Set<Identifier>>, val currentScanFilter: ScanningState.DeviceDiscoveryMode.Scanning) : ScanningState.Devices

Default implementation of ScanningState.Devices

Link copied to clipboard

A default implementation of BaseScanner

A default implementation of BaseScanner

A default implementation of BaseScanner

A default implementation of BaseScanner

A default implementation of BaseScanner backed by the Web Bluetooth API.

Link copied to clipboard
typealias EnableSensorAction = suspend () -> Boolean
Link copied to clipboard
typealias Filter = Set<UUID>

A set of UUID to apply to a scan result If not empty, only ConnectableDevice that are advertising at least one Service matching one of the UUID will be scanned.

Link copied to clipboard
Link copied to clipboard
sealed interface ScanningState : KalugaState

The KalugaState of scanning for Bluetooth devices

Link copied to clipboard

A StateRepo/MutableStateFlow of ScanningState

Link copied to clipboard
open class ScanningStateImplRepo(createScanner: suspend () -> Scanner, contextForIdentifier: (Identifier) -> CoroutineContext, coroutineContext: CoroutineContext) : BaseScanningStateRepo

A BaseScanningStateRepo managed using a Scanner

Link copied to clipboard
class ScanningStateRepo(settingsBuilder: suspend (CoroutineContext) -> BaseScanner.Settings, builder: BaseScanner.Builder, contextForIdentifier: (Identifier) -> CoroutineContext, coroutineContext: CoroutineContext) : ScanningStateImplRepo
Link copied to clipboard
data class WebDevicePickerSettings(val title: String = "Bluetooth Devices", val addButtonLabel: String = "Add Device", val emptyLabel: String = "No devices added yet", val cssClassPrefix: String = "kaluga-bluetooth", val containerId: String? = null)

Configures the on-screen "Add Device" overlay rendered by the Web Bluetooth DefaultScanner.

Functions

Link copied to clipboard
suspend fun ScanningState.Enabled.Scanning.discoverDevice(identifier: Identifier, rssi: RSSI, advertisementData: BaseAdvertisementData, deviceCreator: () -> ConnectableDevice): suspend () -> ScanningState.Enabled.Scanning

Transitions into a Scanning state where a ConnectableDevice is added or updated