CentralManager

Android-specific interface of the Central Manager.

This interface extends CentralManager and adds support for bonded devices, connecting and scanning using Android-specific options, and getting peripherals by their MAC addresses.

Types

Link copied to clipboard
sealed class ConnectionOptions

Android-specific connection options.

Link copied to clipboard
object Factory
Link copied to clipboard
data class ScanOptions(val mode: ScanMode = ScanMode.LOW_LATENCY, val passive: Boolean = false, val legacyOnly: Boolean = false, val phy: PrimaryPhy? = null)

Android-specific scan options.

Properties

Link copied to clipboard
abstract var logger: Log.Sink<Layer>?
Link copied to clipboard
abstract val state: StateFlow<Manager.State>

Functions

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
open suspend override fun connect(peripheral: Peripheral)

Establishes Bluetooth LE connection to the peripheral using default connection options.

abstract suspend fun connect(peripheral: Peripheral, options: CentralManager.ConnectionOptions)

Establishes Bluetooth LE connection to the peripheral.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.d(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.d(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.debug(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.debug(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.e(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.e(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.error(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.error(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard

Returns a list of peripherals for which the system has bond information.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.i(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.i(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.info(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.info(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable?, message: () -> String)
Link copied to clipboard
abstract fun monitor(timeout: Duration, filter: ConjunctionFilterScope.() -> Unit): Flow<MonitoringEvent<Peripheral>>
Link copied to clipboard
abstract fun range(peripheral: Peripheral, timeout: Duration): Flow<RangeEvent<Peripheral>>
Link copied to clipboard
open fun <C : Log.Category> Relay(sink: () -> Log.Sink<C>?): Log.Sink<C>
Link copied to clipboard
open override fun scan(timeout: Duration, filter: ConjunctionFilterScope.() -> Unit): Flow<ScanResult>

Scans for Bluetooth LE devices using default scan options.

abstract fun scan(timeout: Duration = Duration.INFINITE, options: CentralManager.ScanOptions, filter: ConjunctionFilterScope.() -> Unit = {}): Flow<ScanResult>

Scans for Bluetooth LE devices.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.t(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.t(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.trace(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.trace(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.v(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.v(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.verbose(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.verbose(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.w(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.w(category: C, throwable: Throwable?, message: () -> String)
Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.warn(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.warn(category: C, throwable: Throwable?, message: () -> String)