Package-level declarations

Types

Link copied to clipboard
interface Attribute

The Attribute Protocol allows a device referred to as the server to expose a set of attributes and their associated values to a peer device referred to as the client. These attributes exposed by the server can be discovered, read, and written by a client, and can be indicated and notified by the server.

Link copied to clipboard
actual interface BluetoothMonitor : ServiceMonitor

A ServiceMonitor that monitors whether Bluetooth is enabled

actual interface BluetoothMonitor : ServiceMonitor

A ServiceMonitor that monitors whether Bluetooth is enabled

expect interface BluetoothMonitor : ServiceMonitor

A ServiceMonitor that monitors whether Bluetooth is enabled

actual interface BluetoothMonitor : ServiceMonitor

A ServiceMonitor that monitors whether Bluetooth is enabled

actual interface BluetoothMonitor : ServiceMonitor

A ServiceMonitor that monitors whether Bluetooth is enabled, shared by the JS family (js + wasmJs).

Link copied to clipboard

A Characteristic is an Attribute that contains the value of a single piece of data and any required descriptors that describe the value. It is a value used in a service along with properties and configuration information about how the value is accessed and information about how the value is displayed or represented. A Characteristic may contain one or more Descriptor.

Link copied to clipboard

A CharacteristicProperty determines how a Characteristic Value can be used, or how the Descriptor can be accessed.

Link copied to clipboard

Default BluetoothMonitor for the JS family. Web Bluetooth's powered-on/adapter state is only available asynchronously (navigator.bluetooth.getAvailability()), so this uses the presence of the Web Bluetooth API as a synchronous proxy for "enabled" — sufficient to gate the scanner, which surfaces the real availability when the user opens the device picker.

Link copied to clipboard
interface Descriptor : Attribute

Characteristic descriptors are used to contain related information about the Characteristic Value. The GATT profile defines a standard set of characteristic descriptors that can be used by higher layer profiles. Higher layer profiles may define additional characteristic descriptors that are profile specific.

Link copied to clipboard

An Exception thrown when RemoteAttribute.read could not read into a data object

Link copied to clipboard
sealed interface GattResponse

Response given when performing a Bluetooth Gatt Request

Link copied to clipboard
typealias MTU = Int

The maximum transmission unit size

Link copied to clipboard
typealias RSSI = Int

The Received signal strength indication (RSSI)

Link copied to clipboard
interface Service : Attribute

A GATT Service is an Attribute that forms collection of data and associated behaviors to accomplish a particular function or feature. In GATT, a service is defined by its service definition. A service definition may contain included services, mandatory characteristics, and optional characteristics.

Link copied to clipboard
typealias TxPower = Int

The transmission power level in dBm

Link copied to clipboard
actual typealias UUID = java.util.UUID
typealias UUID = java.util.UUID

The Unique Identifier of a Bluetooth property

actual typealias UUID = CBUUID
typealias UUID = CBUUID

The Unique Identifier of a Bluetooth property

expect class UUID

The Unique Identifier of a Bluetooth property

actual data class UUID

The Unique Identifier of a Bluetooth property. On the JS family it wraps the canonical 128-bit lowercase string form that the Web Bluetooth API uses (e.g. BluetoothRemoteGATTService.uuid).

Link copied to clipboard
sealed class UUIDException : Exception

An Exception dealing with issues to the Unique identifier

Link copied to clipboard
actual typealias Value = ByteArray
typealias Value = ByteArray

The value of a bluetooth attribute

actual typealias Value = NSData
typealias Value = NSData

The value of a bluetooth attribute

expect class Value

The value of a platform specific bluetooth attribute

actual typealias Value = ByteArray
typealias Value = ByteArray

The value of a bluetooth attribute. On the JS family GATT values are read as DataViews; they are converted to a ByteArray at the interop boundary, so Value is simply the bytes.

Properties

Link copied to clipboard
actual val Value.asBytes: ByteArray

Gets the ByteArray value of a Value

actual val Value.asBytes: ByteArray

Gets the ByteArray value of a Value

expect val Value.asBytes: ByteArray

Gets the ByteArray value of a Value

actual val Value.asBytes: ByteArray

Gets the ByteArray value of a Value

Link copied to clipboard
actual val UUID.uuidString: String

The string representation of a UUID

actual val UUID.uuidString: String

The string representation of a UUID

expect val UUID.uuidString: String

The string representation of a UUID

actual val UUID.uuidString: String

The string representation of a UUID

Functions

Link copied to clipboard
operator fun <T : Attribute> List<T>.get(uuid: UUID): T

Gets the Attribute of T with the given UUID from a List of T

operator fun <T : Attribute> Flow<List<T>>.get(uuid: UUID): Flow<T>

Gets the Flow of Attribute of T with the given UUID from a Flow of List of T

Link copied to clipboard
fun <T : Attribute> List<T>.getOrNull(uuid: UUID): T?

Gets the Attribute of T with the given UUID from a List of T or null if it cannot be found

fun <T : Attribute> Flow<List<T>>.getOrNull(uuid: UUID): Flow<T?>

Gets the Flow of Attribute of T with the given UUID from a Flow of List of T, or null if it cannot be found

Link copied to clipboard

Gets the Raw Int from a set of CharacteristicProperty

Link copied to clipboard
fun uuidFrom(uuidString: String): UUID

Gets the UUID from a given string