Peripheral
abstract class Peripheral<ID : Any, EX : Peripheral.Executor<ID>>(scope: CoroutineScope, impl: EX) : Peer<ID>
Class representing a Bluetooth LE peripheral.
Types
Properties
Link copied to clipboard
Link copied to clipboard
Returns true if the peripheral is currently connected.
Link copied to clipboard
Returns true if the peripheral is disconnected of getting disconnected.
Link copied to clipboard
The connection state of the peripheral, as StateFlow. The flow emits a new value whenever the state of the peripheral changes.
Functions
Link copied to clipboard
Suspends until the peripheral is disconnected.
Link copied to clipboard
Disconnects the client from the peripheral.
Link copied to clipboard
The maximum amount of data, in bytes, that can be sent to a characteristic in a single write operation.
Link copied to clipboard
suspend fun profile(serviceUuid: Uuid, required: Boolean = true, block: suspend CoroutineScope.(RemoteService) -> Unit)
fun profile(serviceUuid: Uuid, required: Boolean = true, scope: CoroutineScope, block: suspend CoroutineScope.(RemoteService) -> Unit)
Registers a profile implementation that runs when the specified GATT service is discovered.
suspend fun profile(requiredServiceUuids: List<Uuid>, optionalServiceUuids: List<Uuid> = emptyList(), required: Boolean = true, block: suspend CoroutineScope.(List<RemoteService>) -> Unit)
fun profile(requiredServiceUuids: List<Uuid>, optionalServiceUuids: List<Uuid> = emptyList(), required: Boolean = true, scope: CoroutineScope, block: suspend CoroutineScope.(List<RemoteService>) -> Unit)
Registers a profile implementation that runs when the specified GATT services are discovered.
Link copied to clipboard
Returns a flow emitting RemoteServices events.