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 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 val name: String?
Link copied to clipboard
abstract val type: PeripheralType

The Bluetooth device type of the remote device.

Functions

Link copied to clipboard

This method should abort a reliable write transaction.

Link copied to clipboard

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, preferredPhy: List<Phy>)
Link copied to clipboard
abstract suspend fun createBond(): Boolean

This method should initiate bonding with the peripheral.

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

This method should execute all queued reliable write operations.

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
abstract suspend fun removeBond(): Boolean

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

Link copied to clipboard

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.