PeripheralBuilder

actual class PeripheralBuilder
actual class PeripheralBuilder
expect class PeripheralBuilder
actual class PeripheralBuilder
actual class PeripheralBuilder

Properties

Link copied to clipboard

Amount of time to allow system to gracefully disconnect before forcefully closing the peripheral.

Link copied to clipboard
var phy: Phy

Preferred PHY for connections to remote LE device.

Link copied to clipboard
Link copied to clipboard

Preferred transport for GATT connections to remote dual-mode devices.

Functions

Link copied to clipboard
fun autoConnectIf(predicate: () -> Boolean)

Whether to automatically connect as soon as the remote device becomes available (predicate returns trueconnection attempts will wait indefinitely unless wrapped in a withTimeout), or to directly connect to the remote device (predicate returns false — connection attempts timeout after ~30 seconds).

Link copied to clipboard
actual fun logging(init: LoggingBuilder)
actual fun logging(init: <Error class: unknown class>)
expect fun logging(init: LoggingBuilder)
actual fun logging(init: LoggingBuilder)
actual fun logging(init: LoggingBuilder)
Link copied to clipboard
actual fun observationExceptionHandler(handler: <Error class: unknown class>)

Registers an ObservationExceptionHandler for the Peripheral. When registered, observation failures are passed to the ObservationExceptionHandler instead of through observation flows. Any exceptions in the ObservationExceptionHandler will propagate through (and terminate) the associated observation flow.

Link copied to clipboard
actual fun onServicesDiscovered(action: <Error class: unknown class>)

Registers a ServicesDiscoveredAction for the Peripheral that is invoked after initial service discovery (upon establishing a connection).