Executor

interface Executor<ID : Any>

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

The peripheral identifier.

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
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 fun connect(autoConnect: Boolean, preferredPhy: List<Phy> = listOf(Phy.PHY_LE_1M))

Makes a connection to the peripheral.

Link copied to clipboard
abstract fun disconnect(): Boolean

Disconnects from the peripheral.

Link copied to clipboard
abstract fun discoverServices(): Boolean

Initiates GATT services discovery.

Link copied to clipboard
abstract fun readRssi(): Boolean

Initiates a read of the RSSI value from the peripheral.