CommissioningRequest.Builder

@AutoBuilder
interface CommissioningRequest.Builder


Builder for constructing a CommissioningRequest instance.

Summary

Public functions

CommissioningRequest!

Builds the request as configured in this builder.

CommissioningRequest.Builder!

Set the ComponentName of an exported service which will return a in its onBind implementation.

CommissioningRequest.Builder!

Sets the information about the target device to be commissioned, if known.

CommissioningRequest.Builder!

Sets a suggested name for the device, which will be shown to the user after commissioning completes, and the chosen value will be returned in CommissioningResult.

CommissioningRequest.Builder!

Sets the onboarding payload for the target device.

CommissioningRequest.Builder!

Sets whether the device will be commissioned onto the Google fabric.

Public functions

build

fun build(): CommissioningRequest!

Builds the request as configured in this builder.

setCommissioningService

@CanIgnoreReturnValue
fun setCommissioningService(commissioningService: ComponentName?): CommissioningRequest.Builder!

Set the ComponentName of an exported service which will return a in its onBind implementation.

setDeviceInfo

@CanIgnoreReturnValue
fun setDeviceInfo(deviceInfo: DeviceInfo?): CommissioningRequest.Builder!

Sets the information about the target device to be commissioned, if known. For example, if you already know the device's vendor/product ID and discriminator, it can be provided here to restrict which device should be set up in the flow.

If not set, then a user can commission any Matter device.

setDeviceNameHint

@CanIgnoreReturnValue
fun setDeviceNameHint(deviceNameHint: String?): CommissioningRequest.Builder!

Sets a suggested name for the device, which will be shown to the user after commissioning completes, and the chosen value will be returned in CommissioningResult. This can be used in lieu of providing a commissioning service, if only a name suggestion is desired. If both are provided, the callback will still be queried for a name suggestion, but this hint will be used as a fallback if your callback does not return a suggestion.

setOnboardingPayload

@CanIgnoreReturnValue
fun setOnboardingPayload(onboardingPayload: String?): CommissioningRequest.Builder!

Sets the onboarding payload for the target device. This should be used if you already have established proof of possession, either via a manual pairing code, NFC tag, or QR code scan.

If set, the user will not be required to scan the QR code, NFC tag, or enter a code to initiate commissioning.

Note that the device information in this payload takes precedence over any information provided in setDeviceInfo.

Parameters
onboardingPayload: String?

the text contents of the payload (e.g. QR code string or manual pairing code)

setStoreToGoogleFabric

@CanIgnoreReturnValue
fun setStoreToGoogleFabric(storeToGoogleFabric: Boolean): CommissioningRequest.Builder!

Sets whether the device will be commissioned onto the Google fabric.

Returns
CommissioningRequest.Builder!

this builder