Executor

interface Executor<ID : Any> : Log.IdentifiableEmitter<ID>

An interface that provides methods to interact with the peripheral.

The implementation should initiate requests and report events using events flow.

Properties

Link copied to clipboard
abstract val events: SharedFlow<GattEvent>

A flow of GATT events from the peripheral.

Link copied to clipboard
abstract val identifier: ID
Link copied to clipboard

The initial services of the peripheral.

Link copied to clipboard

The initial state of the peripheral.

Link copied to clipboard
abstract val isClosed: Boolean

Returns true if the connection is closed.

Link copied to clipboard

Returns true it reliable write is in progress.

Link copied to clipboard
abstract var logger: Log.Sink<Layer>?

An object that will receive log events generated by the executor.

Link copied to clipboard
abstract val name: String?

The name of the device, if available.

Functions

Link copied to clipboard
abstract fun close()

Closes the connection to the peripheral.

Link copied to clipboard
abstract suspend fun connect(autoConnect: Boolean, preferredPhy: List<Phy> = listOf(Phy.PHY_LE_1M))

Makes a 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

Disconnects from the peripheral.

Link copied to clipboard
abstract suspend fun discoverServices(uuids: List<Uuid>): Boolean

Initiates GATT services discovery.

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
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 override fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable)
open override fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable?, message: () -> String)
Link copied to clipboard
abstract suspend fun readRssi(): Boolean

Initiates a read of the RSSI value from the peripheral.

Link copied to clipboard
open override fun <C : Log.Category> Relay(sink: () -> Log.Sink<C>?): Log.Sink<C>
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)