class

Matter::Endpoint

Inherits Reference < Object

Endpoint represents a single functional unit on a Matter node Each endpoint has a device type and a set of clusters

Constructors

new(endpoint_id : DataType::EndpointNumber, device_types : Array(DeviceType) = [] of DeviceType)
Source
new(endpoint_id : DataType::EndpointNumber, device_type : DeviceType)

Convenience constructor for single device type

Source

Instance methods

add_cluster(cluster : Cluster::Base)

Add a cluster to this endpoint

Source
cluster_count

Get the number of clusters

Source
cluster_ids

Get all cluster IDs

Source
clusters
Source
description

Get a human-readable description of this endpoint

Source
device_types
Source
endpoint_id
Source
get_cluster(cluster_id : UInt32) : Cluster::Base | Nil

Get a cluster by ID

Source
get_cluster(cluster_type : T.class) : T | Nil forall T

Get a typed cluster by class Usage: endpoint.get_cluster(OnOffCluster)

Source
get_cluster!(cluster_id : UInt32) : Cluster::Base

Get a cluster by ID (raises if not found)

Source
get_cluster!(cluster_type : T.class) : T forall T

Get a typed cluster by class (raises if not found)

Source
has_cluster?(cluster_id : UInt32) : Bool

Check if endpoint has a cluster

Source
invoke_command(cluster_id : UInt32, command_id : UInt32, fields : Bytes = Bytes.new(0)) : InteractionModel::Status | Bytes

Invoke a command on a cluster on this endpoint

Source
primary_device_type

Get primary device type

Source
read_attribute(cluster_id : UInt32, attribute_id : UInt32) : InteractionModel::Status | Bytes

Read an attribute from a cluster on this endpoint

Source
valid?

Check if this endpoint is valid (has all required clusters)

Source
validate

Validate that this endpoint satisfies its device type requirements

Source
write_attribute(cluster_id : UInt32, attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute to a cluster on this endpoint

Source