Builder

class Builder<ID>

The builder for the PeripheralSpec.

Parameters

ID

The type of the peripheral identifier.

identifier

The peripheral identifier.

proximity

Approximate distance to the peripheral.

Functions

Link copied to clipboard
fun advertising(parameters: AdvertisingSetParameters = LegacyAdvertisingSetParameters(true), delay: Duration = Duration.ZERO, maxAdvertisingEvents: @Range(from = 1, to = 255) Int, isAdvertisingWhenConnected: Boolean = false, isBeacon: Boolean = false, advertisingData: AdvertisingDataScope.() -> Unit): PeripheralSpec.Builder<ID>
fun advertising(parameters: AdvertisingSetParameters = LegacyAdvertisingSetParameters(true), delay: Duration = Duration.ZERO, timeout: Duration = Duration.INFINITE, isAdvertisingWhenConnected: Boolean = false, isBeacon: Boolean = false, advertisingData: AdvertisingDataScope.() -> Unit): PeripheralSpec.Builder<ID>

Adds an advertising set to the peripheral.

Link copied to clipboard

Makes a connection to the device possible without scanning.

Link copied to clipboard

Makes the device bonded.

Link copied to clipboard

Builds the PeripheralSpec object.

Link copied to clipboard
fun connectable(name: String, connectionInterval: Duration = 45.milliseconds, maxMtu: Int = 23, isPhyLe2MSupported: Boolean = false, isPhyCodedSupported: Boolean = false, eventHandler: PeripheralSpecEventHandler, services: ServerScope.() -> Unit): PeripheralSpec.Builder<ID>

Makes the device connectable, but not connected at the moment of initialization.

Link copied to clipboard
fun connected(name: String, connectionInterval: Duration = 45.milliseconds, maxMtu: Int = 23, isPhyLe2MSupported: Boolean = false, isPhyCodedSupported: Boolean = false, eventHandler: PeripheralSpecEventHandler, services: ServerScope.() -> Unit): PeripheralSpec.Builder<ID>

Makes the device connectable and already connected to the device at the moment of initialization (if it's in range).