Package-level declarations

Types

Link copied to clipboard

Builder class for creating a BluetoothClient object.

Link copied to clipboard
interface BluetoothClient

A service for managing Bluetooth ConnectableDevice

Link copied to clipboard
Link copied to clipboard

The previous name of BluetoothClient

Link copied to clipboard
class DefaultBluetoothClient(coroutineContext: CoroutineContext, scanningStateRepoBuilder: (CoroutineContext) -> ScanningStateFlowRepo) : BluetoothClient, CoroutineScope

The default implementation of BluetoothClient. It uses a ScanningStateFlowRepo to manage the ScanningState

Link copied to clipboard
class DefaultCharacteristicWrapper(characteristic: CBCharacteristic, val service: RemoteServiceWrapper) : RemoteCharacteristicWrapper

Default implementation of RemoteCharacteristicWrapper

class DefaultCharacteristicWrapper(characteristic: CBCharacteristic, val service: RemoteServiceWrapper) : RemoteCharacteristicWrapper

Default implementation of RemoteCharacteristicWrapper

Link copied to clipboard
class DefaultDescriptorWrapper(descriptor: CBDescriptor, val characteristic: RemoteCharacteristicWrapper) : RemoteDescriptorWrapper

Default implementation of RemoteDescriptorWrapper

class DefaultDescriptorWrapper(descriptor: CBDescriptor, val characteristic: RemoteCharacteristicWrapper) : RemoteDescriptorWrapper

Default implementation of RemoteDescriptorWrapper

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class DefaultServiceWrapper(val service: CBService) : RemoteServiceWrapper

Default implementation of RemoteServiceWrapper

class DefaultServiceWrapper(val service: CBService) : RemoteServiceWrapper

Default implementation of RemoteServiceWrapper

Link copied to clipboard

An Attribute for the Client side of a Bluetooth Low Energy connection.

Link copied to clipboard

Accessor to a CBCharacteristic

Accessor to the platform level Bluetooth characteristic

Accessor to a CBCharacteristic

Accessor to a Web Bluetooth BluetoothRemoteGATTCharacteristic. A structural snapshot built during service discovery; the actual read/write/notify go through the connection manager + per-target interop.

Link copied to clipboard

A Descriptor that is accessed remotely by a bluetooth client using BluetoothClient

Link copied to clipboard
actual interface RemoteDescriptorWrapper
actual interface RemoteDescriptorWrapper

Accessor to a CBDescriptor

expect interface RemoteDescriptorWrapper

Accessor to the platform level Bluetooth Descriptor

actual interface RemoteDescriptorWrapper

Accessor to a CBDescriptor

actual interface RemoteDescriptorWrapper

Accessor to a Web Bluetooth BluetoothRemoteGATTDescriptor. A structural snapshot built during service discovery.

Link copied to clipboard

A Service that is accessed remotely by a bluetooth client using BluetoothClient

Link copied to clipboard
actual interface RemoteServiceWrapper

Accessor to a BluetoothGattService

actual interface RemoteServiceWrapper

Accessor to a CBService

expect interface RemoteServiceWrapper

Accessor to the platform level Bluetooth service

actual interface RemoteServiceWrapper

Accessor to a CBService

actual interface RemoteServiceWrapper

Accessor to a Web Bluetooth BluetoothRemoteGATTService. A structural snapshot built during the (async) service discovery in the connection manager.

Properties

Link copied to clipboard
val defaultBluetoothClientDispatcher: CloseableCoroutineDispatcher

Functions

Link copied to clipboard
Link copied to clipboard

Gets a (Flow of) the list RemoteCharacteristic associated with the RemoteService in a Flow

Link copied to clipboard
suspend fun Flow<ConnectableDevice?>.connect(reconnectionSettings: ConnectionSettings.ReconnectionSettings? = null): Boolean

Attempts to connect to the ConnectableDevice from a Flow of ConnectableDevice When this method completes, the devices should be in a ConnectableDeviceState.Connected state

Link copied to clipboard

Gets a (Flow of) the list RemoteDescriptor associated with the RemoteCharacteristic in a Flow

Link copied to clipboard
suspend fun Flow<ConnectableDevice?>.disconnect()

Attempts to disconnect to the ConnectableDevice from a Flow of ConnectableDevice When this method completes, the devices should be in a ConnectableDeviceState.Disconnected state

Link copied to clipboard

Gets a (Flow of) the list of Service associated with the ConnectableDevice This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state. This differs from services in that the resulting flow will only emit once services are discovered.

Gets a (Flow of) the list of Service associated with the ConnectableDevice in a Flow This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state. This differs from services in that the resulting flow will only emit once services are discovered.

Link copied to clipboard
fun ConnectableDevice.distance(environmentalFactor: Double = 2.0, averageOver: Int = 5): Flow<Double>

Gets the (Flow of) the distance in meters between the scanner and a ConnectableDevice. To get a more stable result, this method will average the distance over the last averageOver results.

fun Flow<ConnectableDevice?>.distance(environmentalFactor: Double = 2.0, averageOver: Int = 5): Flow<Double>

Gets the (Flow of) the distance in meters between the scanner and a Flow of ConnectableDevice. To get a more stable result, this method will average the distance over the last averageOver results.

Link copied to clipboard
Link copied to clipboard
operator fun Flow<List<ConnectableDevice>>.get(identifier: Identifier): Flow<ConnectableDevice?>

Gets a (Flow of) ConnectableDevice with a given Identifier from a Flow of a list of ConnectableDevice.

Link copied to clipboard

Gets a (Flow of) the list RemoteService that are included with the RemoteService in a Flow

Link copied to clipboard
fun Flow<ConnectableDevice?>.info(): Flow<DeviceInfo>

Gets the (Flow of) DeviceInfo from a Flow of ConnectableDevice

Link copied to clipboard
fun ConnectableDevice.mtu(): Flow<Int?>

Gets the (Flow of) the MTU from a ConnectableDevice

fun Flow<ConnectableDevice?>.mtu(): Flow<Int?>

Gets the (Flow of) the MTU from a Flow of ConnectableDevice

Link copied to clipboard
suspend fun Flow<ConnectableDevice?>.pair()

Pairs a (Flow of) ConnectableDevice by waiting for it to become connected and calling [ConnectableDeviceState.Connected.pair]

Link copied to clipboard

Attempts to request a MTU size for the ConnectableDevice from a ConnectableDevice

Attempts to request a MTU size for the ConnectableDevice from a Flow of ConnectableDevice

Link copied to clipboard
fun Flow<ConnectableDevice?>.rssi(): Flow<RSSI>

Gets the (Flow of) the RSSI value from a Flow of ConnectableDevice

Link copied to clipboard

Gets a (Flow of) the list of Service associated with the ConnectableDevice This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state.

Gets a (Flow of) the list of Service associated with the ConnectableDevice in a Flow This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state.

Link copied to clipboard
fun Flow<ConnectableDevice?>.state(): Flow<DeviceState>

Gets a (Flow of) DeviceState from a Flow or ConnectableDevice

Link copied to clipboard
suspend fun Flow<ConnectableDevice?>.unpair()

Pairs a (Flow of) ConnectableDevice by calling [ConnectableDeviceState.unpair] on the first ConnectableDeviceState

Link copied to clipboard

Attempts to request an update to the RSSI of the ConnectableDevice from a ConnectableDevice When this method completes, the devices should have had ConnectableDeviceState.Connected.readRssi called

suspend fun Flow<ConnectableDevice?>.updateRssi()

Attempts to request an update to the RSSI of the ConnectableDevice from a Flow of ConnectableDevice When this method completes, the devices should have had ConnectableDeviceState.Connected.readRssi called

Link copied to clipboard

Gets a (Flow of) the ByteArray value from a RemoteCharacteristic This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

Gets a (Flow of) the ByteArray value from a Flow of an RemoteCharacteristic This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

inline fun <T> RemoteCharacteristic.value(bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T>
fun <T> RemoteCharacteristic.value(deserializationStrategy: DeserializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T>

Gets a (Flow of) T value from a RemoteCharacteristic This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

inline fun <T> Flow<RemoteCharacteristic?>.value(bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T>
fun <T> Flow<RemoteCharacteristic?>.value(deserializationStrategy: DeserializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T>

Gets a (Flow of) T value from a Flow of an RemoteCharacteristic This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

Link copied to clipboard

Gets a (Flow of) the ByteArray value from a Flow of an RemoteCharacteristic or an empty ByteArray if data is unavailable This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

Link copied to clipboard
inline fun <T> Flow<RemoteCharacteristic?>.valueOrNull(bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T?>

Gets a (Flow of) T value from a Flow of an RemoteCharacteristic This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected

fun <T> Flow<RemoteCharacteristic?>.valueOrNull(deserializationStrategy: DeserializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T?>

Gets a (Flow of) T value from a Flow of an RemoteCharacteristic or null if data is unavailable This method will automatically subscribe/unsubscribe to the RemoteCharacteristic when the Flow is collected