Executor

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
open val address: String

MAC address of the device.

Link copied to clipboard
abstract val bondState: StateFlow<BondState>

Bonding state as a state flow.

Link copied to clipboard
abstract val encryptionState: StateFlow<EncryptionState>

The state of the encryption of the link as a state flow.

Link copied to clipboard
abstract override val environment: AndroidEnvironment
Link copied to clipboard
abstract val events: SharedFlow<GattEvent>
Link copied to clipboard
abstract val identifier: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val isClosed: Boolean
Link copied to clipboard
Link copied to clipboard
abstract var logger: Log.Sink<Layer>?
Link copied to clipboard
abstract val name: String?
Link copied to clipboard
abstract val operationMutex: OperationMutex
Link copied to clipboard
abstract val type: PeripheralType

The Bluetooth device type of the remote device.

Functions

Link copied to clipboard
abstract suspend fun abortReliableWrite(): Boolean

This method should abort a reliable write transaction.

Link copied to clipboard
abstract fun beginReliableWrite(): Boolean

This method should initiate a reliable write transaction.

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun connect(autoConnect: Boolean, autoMtu: Boolean, opportunistic: Boolean)
Link copied to clipboard
abstract suspend fun createBond(): Boolean

This method should initiate bonding with 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
Link copied to clipboard
abstract suspend fun discoverServices(uuids: List<Uuid>): Boolean
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
abstract suspend fun executeReliableWrite(): Boolean

This method should execute all queued reliable write operations.

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 readPhy(): Boolean

This method should initiate reading the current PHY parameters.

Link copied to clipboard
abstract suspend fun readRssi(): Boolean
Link copied to clipboard
abstract suspend fun refreshCache(): Boolean

Refreshes services cache.

Link copied to clipboard
open override fun <C : Log.Category> Relay(sink: () -> Log.Sink<C>?): Log.Sink<C>
Link copied to clipboard
abstract suspend fun removeBond(): Boolean

This method should initiate removing bond information associated with the peripheral.

Link copied to clipboard
open suspend override fun <T> repeatingAfterBonding(request: suspend () -> T): T

Executes a GATT request, and repeats it once if the system did not, after bonding that was started because the link had to be authenticated or encrypted.

Link copied to clipboard
abstract suspend fun requestConnectionPriority(priority: ConnectionPriority): Boolean

Requests the connection priority to be changed.

Link copied to clipboard
abstract suspend fun requestMtu(mtu: @Range(from = 23, to = 517) Int): Boolean

Requests the MTU (Maximum Transmission Unit) to be set to the given value.

Link copied to clipboard
abstract suspend fun requestPhy(txPhy: Phy, rxPhy: Phy, phyOptions: PhyOption): Boolean

Requests the PHY to be changed.

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)