Package-level declarations
Types
Link copied to clipboard
class AndroidMockCharacteristicWrapper(val uuid: UUID = UUID.randomUUID(), descriptorUUIDs: List<UUID> = emptyList(), val service: RemoteServiceWrapper, val properties: Set<CharacteristicProperty> = emptySet()) : MockCharacteristicWrapper
Link copied to clipboard
class AndroidMockDescriptorWrapper(val uuid: UUID = UUID.randomUUID(), val characteristic: RemoteCharacteristicWrapper) : MockDescriptorWrapper
Link copied to clipboard
class AppleMockCharacteristicWrapper(val uuid: CBUUID = CBUUID(), val properties: Set<CharacteristicProperty> = emptySet(), val service: RemoteServiceWrapper = MockServiceWrapper(), descriptorUUIDs: List<CBUUID> = emptyList()) : MockCharacteristicWrapper
Link copied to clipboard
class AppleMockDescriptorWrapper(val uuid: CBUUID = CBUUID(), val characteristic: RemoteCharacteristicWrapper = AppleMockCharacteristicWrapper()) : MockDescriptorWrapper
Link copied to clipboard
Link copied to clipboard
class ConnectedMockClient
A mock Bluetooth device that has been connected and had its services discovered, ready to route reads and writes.
Link copied to clipboard
interface ContainsMockValue
Link copied to clipboard
Link copied to clipboard
class IOSMockCharacteristicWrapper(val uuid: CBUUID = CBUUID(), val properties: Set<CharacteristicProperty> = emptySet(), val service: RemoteServiceWrapper = MockServiceWrapper(), descriptorUUIDs: List<CBUUID> = emptyList()) : MockCharacteristicWrapper
Link copied to clipboard
class IOSMockDescriptorWrapper(val uuid: CBUUID = CBUUID(), val characteristic: RemoteCharacteristicWrapper = IOSMockCharacteristicWrapper()) : MockDescriptorWrapper
Link copied to clipboard
class MockBluetoothClient(val discoveredDevicesFlow: MutableStateFlow<List<ConnectableDevice>> = MutableStateFlow(emptyList()), val filteredDevicesFlow: MutableStateFlow<Map<Filter, List<ConnectableDevice>>> = MutableStateFlow(emptyMap()), val pairedDevicesFlow: MutableStateFlow<Map<Set<UUID>, List<ConnectableDevice>>> = MutableStateFlow(emptyMap()), val isEnabled: MutableStateFlow<Boolean> = MutableStateFlow(true), setupMocks: Boolean = true) : BluetoothClient
Link copied to clipboard
A mock implementation of BaseBluetoothClientBuilder that creates MockBluetoothClients.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class MockCBPeripheralWrapper(val name: String? = null, val identifier: NSUUID = NSUUID()) : DeviceWrapper
data class MockCBPeripheralWrapper(val name: String? = null, val identifier: NSUUID = NSUUID()) : DeviceWrapper
Link copied to clipboard
class MockCharacteristic(characteristic: RemoteCharacteristicWrapper, emitNewAction: (DeviceConnectionManager.Event.AddAction) -> Unit) : RemoteCharacteristic
Mock implementation of RemoteCharacteristic
Link copied to clipboard
Link copied to clipboard
class MockDescriptor(descriptorWrapper: RemoteDescriptorWrapper, emitNewAction: (DeviceConnectionManager.Event.AddAction) -> Unit) : RemoteDescriptor
Mock implementation of RemoteDescriptor
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class MockDeviceInfoBuilder
Link copied to clipboard
class MockDeviceWrapper(val name: String?, val identifier: Identifier, val bondState: DeviceWrapper.BondState, setupMocks: Boolean = true) : DeviceWrapper
Link copied to clipboard
class MockRemoteServiceWrapper(val uuid: UUID = UUID.randomUUID(), initialCharacteristics: List<ServiceWrapperBuilder.Characteristic> = emptyList()) : RemoteServiceWrapper
Link copied to clipboard
class MockServiceWrapper(val uuid: UUID = UUID(), val type: Service.Type = Service.Type.PRIMARY, val characteristics: List<RemoteCharacteristicWrapper> = emptyList(), val includedServices: List<RemoteServiceWrapper> = emptyList()) : RemoteServiceWrapper
class MockServiceWrapper(val uuid: UUID = UUID(), val type: Service.Type = Service.Type.PRIMARY, val characteristics: List<RemoteCharacteristicWrapper> = emptyList(), val includedServices: List<RemoteServiceWrapper> = emptyList()) : RemoteServiceWrapper
Link copied to clipboard
Link copied to clipboard
class ServiceWrapperBuilder
Link copied to clipboard
class WebMockCharacteristicWrapper(val uuid: UUID = randomUUID(), val properties: Set<CharacteristicProperty> = emptySet(), val service: RemoteServiceWrapper = WebMockServiceWrapper(), descriptorUUIDs: List<UUID> = emptyList()) : MockCharacteristicWrapper
Link copied to clipboard
class WebMockDescriptorWrapper(val uuid: UUID = randomUUID(), val characteristic: RemoteCharacteristicWrapper = WebMockCharacteristicWrapper()) : MockDescriptorWrapper
Link copied to clipboard
class WebMockServiceWrapper(val uuid: UUID = randomUUID(), initialCharacteristics: List<ServiceWrapperBuilder.Characteristic> = emptyList()) : RemoteServiceWrapper
Functions
Link copied to clipboard
Link copied to clipboard
Build MockDevice, see MockDeviceBuilder
Link copied to clipboard
fun CharacteristicList.characteristic(builder: ServiceWrapperBuilder.Characteristic.Builder.() -> Unit): Boolean
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
expect fun createDeviceWrapper(deviceName: String? = null, identifier: Identifier = randomIdentifier()): DeviceWrapper
Link copied to clipboard
fun createMockDevice(wrapper: DeviceWrapper, coroutineScope: CoroutineScope, connectionSettings: ConnectionSettings = ConnectionSettings(
reconnectionSettings = ConnectionSettings.ReconnectionSettings.Never,
), connectionManagerBuilder: MockDeviceConnectionManager.Builder = MockDeviceConnectionManager.Builder(), createDeviceStateFlow: (DeviceConnectionManager, CoroutineContext) -> ConnectableDeviceStateFlowRepo = { manager, coroutineContext ->
ConnectableDeviceStateImplRepo(connectionSettings.reconnectionSettings, manager, coroutineContext)
}, builder: MockDeviceInfoBuilder.() -> Unit): ConnectableDeviceImpl
fun createMockDevice(identifier: Identifier, connectionSettings: ConnectionSettings = ConnectionSettings(
reconnectionSettings = ConnectionSettings.ReconnectionSettings.Never,
), connectionManagerBuilder: (ConnectionSettings) -> DeviceConnectionManager, builder: MockDeviceInfoBuilder.() -> Unit, createDeviceStateFlow: (DeviceConnectionManager, CoroutineContext) -> ConnectableDeviceStateFlowRepo = { manager, coroutineContext ->
ConnectableDeviceStateImplRepo(connectionSettings.reconnectionSettings, manager, coroutineContext)
}, coroutineScope: CoroutineScope): ConnectableDeviceImpl
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard