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

This method should initiate bonding with the peripheral.

Link copied to clipboard
abstract fun disconnect(): Boolean
Link copied to clipboard
abstract fun discoverServices(): Boolean
Link copied to clipboard
abstract fun readPhy(): Boolean

This method should initiate reading the current PHY parameters.

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

Refreshes services cache.

Link copied to clipboard
abstract 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 fun requestMtu(mtu: Int): Boolean

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

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

Requests the PHY to be changed.