MockBaseScanner

class MockBaseScanner(initialBluetoothEnabled: Boolean, settings: BaseScanner.Settings, coroutineScope: CoroutineScope, scanningDispatcher: CoroutineDispatcher, val isSupported: Boolean = true) : BaseScanner

Mock implementation of BaseScanner

Parameters

initialBluetoothEnabled

Sets the initial enabled state of bluetooth

settings

BaseScanner.Settings to configure this scanner

coroutineScope

The CoroutineScope to run this Scanner on

scanningDispatcher

the CoroutineDispatcher to which scanning should be dispatched. It is recommended to make this a dispatcher that can handle high frequency of events

isSupported

Indicates whether the system supports Bluetooth scanning

Constructors

Link copied to clipboard
constructor(initialBluetoothEnabled: Boolean, settings: BaseScanner.Settings, coroutineScope: CoroutineScope, scanningDispatcher: CoroutineDispatcher, isSupported: Boolean = true)

Types

Link copied to clipboard
class Builder(initialBluetoothEnabled: Boolean, setupMocks: Boolean = true) : BaseScanner.Builder

Mock implementation of BaseScanner.Builder

Properties

Link copied to clipboard
Link copied to clipboard
open override val connectionEvents: Flow<Scanner.ConnectionEvent>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val events: Flow<Scanner.Event>
Link copied to clipboard
val isEnabled: MutableStateFlow<Boolean>

Manages bluetooth enabled state

Link copied to clipboard
open override val isSupported: Boolean = true

Functions

Link copied to clipboard
open override fun cancelRetrievingPairedDevices()
Link copied to clipboard
open override fun handleDeviceDiscovered(deviceWrapper: DeviceWrapper, rssi: RSSI, advertisementData: BaseAdvertisementData, deviceCreator: (CoroutineContext) -> Device)
Link copied to clipboard
open suspend override fun isHardwareEnabled(): Boolean
Link copied to clipboard
open suspend override fun requestEnableHardware()
Link copied to clipboard
open suspend override fun retrievePairedDevices(withServices: Filter, removeForAllPairedFilters: Boolean, connectionSettings: ConnectionSettings?)
Link copied to clipboard
suspend override fun scanForDevices(filter: Filter, connectionSettings: ConnectionSettings?)
Link copied to clipboard
open suspend override fun startMonitoringHardwareEnabled()
Link copied to clipboard
open suspend override fun startMonitoringPermissions()
Link copied to clipboard
open suspend override fun stopMonitoringHardwareEnabled()
Link copied to clipboard
open suspend override fun stopMonitoringPermissions()
Link copied to clipboard
suspend override fun stopScanning()