WebBluetoothPeripheral
Properties
Link copied to clipboard
Link copied to clipboard
Platform specific identifier for the remote peripheral. On some platforms, this can be used to "restore" a previously known peripheral for reconnection.
Link copied to clipboard
The list of services (GATT profile) which have been discovered on the remote peripheral.
Link copied to clipboard
Provides a conflated Flow of the Peripheral's State.
Functions
Link copied to clipboard
Disconnects the active connection, or cancels an in-flight connection attempt, suspending until Peripheral has settled on a disconnected state.
Link copied to clipboard
Return the current ATT MTU size, minus the size of the ATT headers (3 bytes).
Link copied to clipboard
abstract fun observe(characteristic: Characteristic, onSubscription: OnSubscriptionAction = {}): Flow<ByteArray>
Observes changes to the specified Characteristic.
Link copied to clipboard
abstract fun observeDataView(characteristic: Characteristic, onSubscription: OnSubscriptionAction = {}): Flow<DataView>
Link copied to clipboard
fun CoroutineScope.peripheral(bluetoothDevice: BluetoothDevice, builderAction: PeripheralBuilderAction = {}): Peripheral
fun CoroutineScope.peripheral(identifier: Identifier, builderAction: PeripheralBuilderAction = {}): Peripheral
expect fun CoroutineScope.peripheral(advertisement: Advertisement, builderAction: PeripheralBuilderAction = {}): Peripheral
actual fun CoroutineScope.peripheral(advertisement: Advertisement, builderAction: PeripheralBuilderAction): Peripheral
actual fun CoroutineScope.peripheral(advertisement: Advertisement, builderAction: PeripheralBuilderAction): Peripheral
Link copied to clipboard
Reads data from characteristic.
Reads data from descriptor.
Link copied to clipboard
Link copied to clipboard
Writes data to descriptor.
abstract suspend fun write(characteristic: Characteristic, data: ByteArray, writeType: WriteType = WithoutResponse)
Writes data to characteristic.