class Matter::Cluster::DescriptorCluster

Overview

Descriptor Cluster (0x001D)

Provides device composition information including device types, server/client clusters, and endpoint hierarchy.

Required on all endpoints.

Matter Spec: Core 9.5

Defined in:

matter/cluster/descriptor_cluster.cr

Constant Summary

ATTR_CLIENT_LIST = 2_u32
ATTR_DEVICE_TYPE_LIST = 0_u32

Attributes

ATTR_PARTS_LIST = 3_u32
ATTR_SERVER_LIST = 1_u32
CLUSTER_ID = 29_u32

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Matter::Cluster::Base

attributes : Array(AttributeMetadata) attributes, cluster_id : DataType::ClusterId cluster_id, cluster_id=(cluster_id : DataType::ClusterId) cluster_id=, commands : Array(CommandMetadata) commands, data_version : UInt32 data_version, data_version=(data_version : UInt32) data_version=, endpoint_id : DataType::EndpointNumber endpoint_id, endpoint_id=(endpoint_id : DataType::EndpointNumber) endpoint_id=, events : Array(EventMetadata) events, get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil get_attribute_metadata, get_command_metadata(command_id : UInt32) : CommandMetadata | Nil get_command_metadata, invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0), session_id : UInt64 | Nil = nil) : InteractionModel::Status | CommandResponse invoke_command, name : String name, read_attribute(attribute_id : UInt32) : InteractionModel::Status | Bytes read_attribute, write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status write_attribute

Constructor methods inherited from class Matter::Cluster::Base

new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId) new

Constructor Detail

def self.new(endpoint_id : DataType::EndpointNumber) #

[View source]

Class Method Detail

def self.cluster_id #

Descriptor Cluster (0x001D)

Provides device composition information including device types, server/client clusters, and endpoint hierarchy.

Required on all endpoints.

Matter Spec: Core 9.5


[View source]

Instance Method Detail

def add_client(cluster_class : Base.class) #

Add a client cluster by class

@param cluster_class The cluster class (e.g., OnOffCluster) @return self for chaining

Example: descriptor.add_client(OnOffCluster) .add_client(LevelControlCluster)


[View source]
def add_part(endpoint_id : UInt16) #

Add a child endpoint to the parts list

@param endpoint_id The endpoint ID @return self for chaining

Example: descriptor.add_part(1_u16) .add_part(2_u16)


[View source]
def add_server(cluster_class : Base.class) #

Add a server cluster by class

@param cluster_class The cluster class (e.g., OnOffCluster) @return self for chaining

Example: descriptor.add_server(OnOffCluster) .add_server(LevelControlCluster)


[View source]
def attributes : Array(AttributeMetadata) #
Description copied from class Matter::Cluster::Base

Get all attribute metadata


[View source]
def client_list : Array(UInt32) #

[View source]
def client_list=(client_list : Array(UInt32)) #

[View source]
def commands : Array(CommandMetadata) #
Description copied from class Matter::Cluster::Base

Get all command metadata


[View source]
def device_type_list : Array(DeviceTypeStruct) #

Attribute storage


[View source]
def device_type_list=(device_type_list : Array(DeviceTypeStruct)) #

Attribute storage


[View source]
def has_client_cluster?(cluster_id : UInt32) : Bool #

Helper: Check if a cluster is in the client list


[View source]
def has_client_cluster?(cluster_class : Base.class) : Bool #

Helper: Check if a cluster is in the client list (by class)


[View source]
def has_part?(endpoint_id : UInt16) : Bool #

Helper: Check if an endpoint is in the parts list


[View source]
def has_server_cluster?(cluster_id : UInt32) : Bool #

Helper: Check if a cluster is in the server list


[View source]
def has_server_cluster?(cluster_class : Base.class) : Bool #

Helper: Check if a cluster is in the server list (by class)


[View source]
def name : String #
Description copied from class Matter::Cluster::Base

Get cluster name


[View source]
def parts_list : Array(UInt16) #

[View source]
def parts_list=(parts_list : Array(UInt16)) #

[View source]
def primary_device_type : DeviceTypeStruct | Nil #

Helper: Get primary device type


[View source]
def read_attribute(attribute_id : UInt32) : InteractionModel::Status | Bytes #
Description copied from class Matter::Cluster::Base

Read an attribute value


[View source]
def server_list : Array(UInt32) #

[View source]
def server_list=(server_list : Array(UInt32)) #

[View source]
def write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status #
Description copied from class Matter::Cluster::Base

Write an attribute value


[View source]