DeviceDescriptor.Builder

class DeviceDescriptor.Builder


Builder class to generate DeviceDescriptor instances.

Summary

Public constructors

Public functions

DeviceDescriptor!

Builds a new instance of DeviceDescriptor.

DeviceDescriptor.Builder!

This function is deprecated.

this field is not expected to be populated; the vendor ID and product ID can be used to map to a device type

DeviceDescriptor.Builder!

Sets the Product ID of the device.

DeviceDescriptor.Builder!
@CanIgnoreReturnValue
setVendorId(vendorId: @IntRange(from = 0, to = 65535) Int)

Sets the Vendor ID of the device.

Public constructors

Builder

Builder()

Public functions

build

fun build(): DeviceDescriptor!

Builds a new instance of DeviceDescriptor.

Throws
java.lang.IllegalStateException

if a product ID is specified without specifying a vendor ID

setDeviceType

@CanIgnoreReturnValue
fun setDeviceType(deviceType: Int): DeviceDescriptor.Builder!

Set the Matter device type to indicate the device's primary functionality. If the device type is unknown, this may be left as zero.

Returns
DeviceDescriptor.Builder!

this builder

setProductId

@CanIgnoreReturnValue
fun setProductId(productId: Int): DeviceDescriptor.Builder!

Sets the Product ID of the device. Note that if a product ID is specified, then the vendor ID *must* also be specified via setVendorId.

Parameters
productId: Int

the product ID of the device, specific to the vendor

Returns
DeviceDescriptor.Builder!

this builder

setVendorId

@CanIgnoreReturnValue
fun setVendorId(vendorId: @IntRange(from = 0, to = 65535) Int): DeviceDescriptor.Builder!

Sets the Vendor ID of the device. Valid vendor IDs are either zero (for unspecified), or are in the range of 0x1 - 0xFFFF, inclusive.

Returns
DeviceDescriptor.Builder!

this builder