highSpeed

fun highSpeed(preferredConnectionInterval: @Range(from = 6, to = 3200) IntRange = IntRange(12, 24), preferredSlaveLatency: @Range(from = 0, to = 499) Int = 0, preferredSupervisionTimeout: @Range(from = 10, to = 3200) Int = 100, maxAttMtu: @Range(from = 23, to = 517) Int = 498, maxL2capMtu: @Range(from = 27, to = 251) Int = 251, isPhyLe2MSupported: Boolean = true): PeripheralSpec.Builder<ID>

Configures the device for high speed connection.

Sets ATT MTU to 498 bytes and L2CAP MTU to 251 bytes and enables PHY LE 2M together with fast connection parameters.

connectable or connected method must be called in addition to this one, for example:

val mock = PeripheralSpec.simulatePeripheral("01:02:03:04:05:06") {
connectable(
name = "High Speed Device",
eventHandler = myEventHandler,
services = {
// Define services here
}
)
highSpeed()
}

Parameters

preferredConnectionInterval

The min and max connection interval, in 1.25 ms units. Valid range is from 6 (7.5ms) to 3200 (4000ms). Default is 15-30 (15-30 ms).

preferredSlaveLatency

Slave latency. Valid range is from 0 to 499. Default is 0.

preferredSupervisionTimeout

Supervision timeout in 10 ms units. Valid range is from 10 (0.1s) to 3200 (32s). Default is 100 (1 s).

maxAttMtu

The maximum supported ATT MTU (Maximum Transfer Unit). This value must be in range 23..517. Default is 498, which allows to fit 2 full L2CAP packets of 251 bytes each into a single ATT packet.

maxL2capMtu

The maximum supported L2CAP MTU (Maximum Transfer Unit used on L2CAP Layer using Data Length Extension (DLE)). This value must be in range 27..251. Default is 251.

isPhyLe2MSupported

Whether the device supports PHY LE 2M, default is true.