Package-level declarations

Types

Link copied to clipboard

Android implementation of BaseAdvertisementData

Platform specific implementation of BaseAdvertisementData

BaseAdvertisementData for the JS family. The requestDevice picker exposes only the device name; RSSI, manufacturer/service data and tx power are not available on the web.

Link copied to clipboard

Data advertised by a Bluetooth Device

Link copied to clipboard
abstract class BaseDeviceConnectionManager(deviceWrapper: DeviceWrapper, settings: ConnectionSettings, coroutineScope: CoroutineScope) : DeviceConnectionManager, CoroutineScope
Link copied to clipboard

A wrapper to access a BluetoothGatt

Link copied to clipboard

A Device that can be connected to

Link copied to clipboard
class ConnectableDeviceImpl(val identifier: Identifier, initialDeviceInfo: DeviceInfoImpl, connectionSettings: ConnectionSettings, connectionManagerBuilder: (ConnectionSettings) -> DeviceConnectionManager, coroutineScope: CoroutineScope, createDeviceStateFlow: (DeviceConnectionManager, CoroutineContext) -> ConnectableDeviceStateFlowRepo = { connectionManager, context -> ConnectableDeviceStateImplRepo(connectionSettings.reconnectionSettings, connectionManager, context) }) : ConnectableDevice, CoroutineScope

Implementation of ConnectableDevice

Link copied to clipboard

A DeviceState for a ConnectableDevice that can be connected to

Link copied to clipboard
sealed interface ConnectedDeviceBinding<T>

Builder for setting up binding to an object T so that it may be changed by a ConnectableDevice.

Link copied to clipboard

Settings to apply to a Device when connecting

Link copied to clipboard
Link copied to clipboard
class DefaultCBPeripheralWrapper(peripheral: CBPeripheral) : DeviceWrapper

Default implementation of DeviceWrapper

Link copied to clipboard

Default implementation of DeviceWrapper

Link copied to clipboard
Link copied to clipboard

A manager for connecting a Device

Link copied to clipboard
interface DeviceInfo

Properties of a Bluetooth Device

Link copied to clipboard
data class DeviceInfoImpl(val deviceName: String?, val identifier: Identifier, val rssi: RSSI, val advertisementData: BaseAdvertisementData) : DeviceInfo

An implementation of DeviceInfo

Link copied to clipboard
sealed interface DeviceState

The state of a Device

Link copied to clipboard
actual interface DeviceWrapper

Accessor to the BluetoothDevice

actual interface DeviceWrapper

Accessor to the CBPeripheral

expect interface DeviceWrapper

Accessor to the platform level Bluetooth device

actual interface DeviceWrapper

Accessor to a Web Bluetooth BluetoothDevice. The live JS device is held in the per-target registry under identifier; this wrapper only carries its identifier and name.

Link copied to clipboard

A DeviceState indicating the ConnectableDevice cannot be connected to

Link copied to clipboard

Builder for setting up binding to an object T so that it may be changed by a RemoteAttribute.

Link copied to clipboard

Builder for setting up binding to an object T so that it may be changed by a RemoteCharacteristic.

Link copied to clipboard

Builder for setting up binding to an object T so that it may be changed by a RemoteDescriptor.

Link copied to clipboard

Builder for setting up binding to an object T so that it may be changed by a RemoteService.

Link copied to clipboard

Builder for setting up binding to an object T so that it may be notified when RemoteService become available / unavailable.

Link copied to clipboard
class WebDeviceWrapper(val identifier: Identifier, val name: String?) : DeviceWrapper

Default implementation of DeviceWrapper for the JS family.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun <T> T.bind(characteristic: RemoteCharacteristic, scope: CoroutineScope, binding: RemoteCharacteristicBinding.EnsuresServicesAvailable<T>.() -> Unit): StateFlow<T>

Binds an object of type T to a RemoteCharacteristic, so that it may be updated according to binding.

fun <T> T.bind(descriptor: RemoteDescriptor, scope: CoroutineScope, binding: RemoteDescriptorBinding<T>.() -> Unit): StateFlow<T>

Binds an object of type T to a RemoteDescriptor, so that it may be updated according to binding.

fun <T> T.bind(service: RemoteService, scope: CoroutineScope, binding: RemoteServiceBinding.EnsuresAvailable<T>.() -> Unit): StateFlow<T>

Binds an object of type T to a RemoteService, so that it may be updated according to binding.

fun <T> T.bind(device: ConnectableDevice, scope: CoroutineScope, binding: ConnectedDeviceBinding.RequiresServicesDiscovered<T>.() -> Unit): StateFlow<T>

Binds an object of type T to a ConnectableDevice, so that it may be updated according to binding

fun <T> T.bind(deviceState: ConnectableDeviceState.Connected.DiscoveredServices, scope: CoroutineScope, binding: ConnectedDeviceBinding.EnsuresAvailable<T>.() -> Unit): StateFlow<T>

Binds an object of type T to a ConnectableDeviceState.Connected.DiscoveredServices state, so that it may be updated according to binding. This assumes services has been discovered and as such any binding will fail if a RemoteAttribute is not available.

@JvmName(name = "bindCharacteristic")
fun <T> T.bind(characteristic: Flow<RemoteCharacteristic?>, scope: CoroutineScope, binding: RemoteCharacteristicBinding.RequiresServicesDiscovered<T>.() -> Unit): StateFlow<T>

Binds an object of type T to the Flow of a RemoteCharacteristic, so that it may be updated according to binding

@JvmName(name = "bindDescriptor")
fun <T> T.bind(descriptor: Flow<RemoteDescriptor?>, scope: CoroutineScope, binding: RemoteDescriptorBinding.RequiresServicesDiscovered<T>.() -> Unit): StateFlow<T>

Binds an object of type T to the Flow of a RemoteDescriptor, so that it may be updated according to binding

@JvmName(name = "bindService")
fun <T> T.bind(service: Flow<RemoteService?>, scope: CoroutineScope, binding: RemoteServiceBinding.RequiresServicesDiscovered<T>.() -> Unit): StateFlow<T>

Binds an object of type T to the Flow of a RemoteService, so that it may be updated according to binding

@JvmName(name = "bindDevice")
fun <T> T.bind(device: Flow<ConnectableDevice?>, scope: CoroutineScope, binding: ConnectedDeviceBinding.RequiresServicesDiscovered<T>.() -> Unit): StateFlow<T>

Binds an object of type T to the Flow of a ConnectableDevice, so that it may be updated according to binding

Link copied to clipboard

Sets up observation of a Notification from the RemoteCharacteristic

Link copied to clipboard
@JvmName(name = "triggerReadFromUnit")
inline fun <Response, T> RemoteAttributeBinding.TriggerResponse<Unit, T>.triggerRead(bluetoothFormat: BluetoothFormat = BluetoothFormat, noinline unitBuilder: RemoteAttributeBinding.UnitReadBuilder.NonMutating<T, Response>.() -> Unit)
fun <Response, T> RemoteAttributeBinding.TriggerResponse<Unit, T>.triggerRead(deserializationStrategy: DeserializationStrategy<Response>, bluetoothFormat: BluetoothFormat = BluetoothFormat, unitBuilder: RemoteAttributeBinding.UnitReadBuilder.NonMutating<T, Response>.() -> Unit)

Responds to a Unit to cause the RemoteAttribute to be read.

Responds to a Trigger to cause the RemoteAttribute to be read.

Link copied to clipboard

Responds to a ByteArray to write it to the RemoteAttribute.

Consumes Trigger from a Channel to write it to the RemoteAttribute.

inline fun <Trigger, Data, T> RemoteAttributeBinding.TriggerResponse<Trigger, T>.triggerWrite(bluetoothFormat: BluetoothFormat = BluetoothFormat, noinline mapper: Trigger.() -> Data, noinline builder: RemoteAttributeBinding.WriteBuilder.NonMutating<T, Trigger>.() -> Unit)

Responds to a Trigger to have Data written to the RemoteAttribute.