Builder for constructing a
CommissioningRequest
instance.
Public Method Summary
abstract CommissioningRequest |
build()
Builds the request as configured in this builder.
|
abstract CommissioningRequest.Builder |
setCommissioningService(ComponentName
commissioningService)
Set the
ComponentName
of an exported service which will return a
CommissioningService in its
Service.onBind(Intent) implementation.
|
abstract CommissioningRequest.Builder |
setDeviceInfo(DeviceInfo
deviceInfo)
Sets the information about the target device to be commissioned, if known.
|
abstract CommissioningRequest.Builder |
setDeviceNameHint(String
deviceNameHint)
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 .
|
abstract CommissioningRequest.Builder |
Public Methods
public abstract CommissioningRequest build ()
Builds the request as configured in this builder.
public abstract CommissioningRequest.Builder setCommissioningService (ComponentName commissioningService)
Set the ComponentName
of an exported service which will return a
CommissioningService
in its
Service.onBind(Intent)
implementation.
public abstract CommissioningRequest.Builder setDeviceInfo (DeviceInfo deviceInfo)
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.
public abstract CommissioningRequest.Builder setDeviceNameHint (String deviceNameHint)
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.
public abstract CommissioningRequest.Builder setOnboardingPayload (String onboardingPayload)
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(DeviceInfo)
.
Parameters
onboardingPayload | the text contents of the payload (e.g. QR code string or manual pairing code) |
---|