CommissioningWindow.Builder

class CommissioningWindow.Builder


Builder class to generate CommissioningWindow instances.

Summary

Public constructors

Public functions

CommissioningWindow!

Builds a new instance of CommissioningWindow

CommissioningWindow.Builder!

Sets the Discriminator of the device opened for commissioning.

CommissioningWindow.Builder!
@CanIgnoreReturnValue
setDurationSeconds(durationSeconds: @IntRange(from = 1) Long)

Sets the duration of the commissioning window.

CommissioningWindow.Builder!
@CanIgnoreReturnValue
setPasscode(passcode: @IntRange(from = 0, to = 99999998) Long)

Sets the passcode of the device opened for commissioning.

CommissioningWindow.Builder!
@CanIgnoreReturnValue
setWindowOpenMillis(windowOpenMillis: @IntRange(from = 1) Long)

Sets the timestamp (in milliseconds) of when the commissioning window was opened.

Public constructors

Builder

Builder()

Public functions

build

fun build(): CommissioningWindow!

Builds a new instance of CommissioningWindow

Throws
java.lang.IllegalStateException

if the device discriminator, passcode, window opened timestamp, or duration are not set.

setDiscriminator

@CanIgnoreReturnValue
fun setDiscriminator(discriminator: Discriminator!): CommissioningWindow.Builder!

Sets the Discriminator of the device opened for commissioning.

setDurationSeconds

@CanIgnoreReturnValue
fun setDurationSeconds(durationSeconds: @IntRange(from = 1) Long): CommissioningWindow.Builder!

Sets the duration of the commissioning window.

setPasscode

@CanIgnoreReturnValue
fun setPasscode(passcode: @IntRange(from = 0, to = 99999998) Long): CommissioningWindow.Builder!

Sets the passcode of the device opened for commissioning.

Throws
java.lang.IllegalArgumentException

if the given passcode is not in the range of 0-99999998, or is one of the specification-defined insecure passwords (1-8, 8-1, all same digits like 11111111)

setWindowOpenMillis

@CanIgnoreReturnValue
fun setWindowOpenMillis(windowOpenMillis: @IntRange(from = 1) Long): CommissioningWindow.Builder!

Sets the timestamp (in milliseconds) of when the commissioning window was opened. The time basis for this value must be elapsedRealtime rather than currentTimeMillis.