connected

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).

Connected devices are also allowed for retrieval.

Parameters

name

The name of the peripheral, available from Device Name characteristic.

connectionInterval

The connection interval when connected.

maxMtu

The maximum supported MTU size.

isPhyLe2MSupported

Whether the device supports PHY LE 2M.

isPhyCodedSupported

Whether the device supports PHY LE Coded.

eventHandler

The event handler that will be called for every event emulating a real peripheral.

services

The services available after service discovery.