abstract class Matter::Cluster::Base

Overview

Base class for all cluster implementations

Direct Known Subclasses

Defined in:

matter/cluster/cluster.cr

Constant Summary

GLOBAL_ACCEPTED_COMMAND_LIST = 65529_u32
GLOBAL_ATTRIBUTE_LIST = 65531_u32

Global attribute IDs (mandatory on all clusters)

GLOBAL_CLUSTER_REVISION = 65533_u32
GLOBAL_FEATURE_MAP = 65532_u32
GLOBAL_GENERATED_COMMAND_LIST = 65528_u32

Constructors

Instance Method Summary

Constructor Detail

def self.new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId) #

[View source]

Instance Method Detail

abstract def attributes : Array(AttributeMetadata) #

Get all attribute metadata


[View source]
def cluster_id : DataType::ClusterId #

[View source]
def cluster_id=(cluster_id : DataType::ClusterId) #

[View source]
def commands : Array(CommandMetadata) #

Get all command metadata


[View source]
def data_version : UInt32 #

[View source]
def data_version=(data_version : UInt32) #

[View source]
def endpoint_id : DataType::EndpointNumber #

[View source]
def endpoint_id=(endpoint_id : DataType::EndpointNumber) #

[View source]
def events : Array(EventMetadata) #

Get all event metadata


[View source]
def get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil #

Get attribute metadata by ID


[View source]
def get_command_metadata(command_id : UInt32) : CommandMetadata | Nil #

Get command metadata by ID


[View source]
def invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0), session_id : UInt64 | Nil = nil, is_case_session : Bool = false, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | CommandResponse #

Invoke a command


[View source]
abstract def name : String #

Get cluster name


[View source]
def on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil #

Callback for attribute change notifications (used by subscription system) Parameters: endpoint_id, cluster_id, attribute_id


[View source]
def on_attribute_changed=(on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil) #

Callback for attribute change notifications (used by subscription system) Parameters: endpoint_id, cluster_id, attribute_id


[View source]
def read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes #

Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster


[View source]
def write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status #

Write an attribute value


[View source]