class Matter::Endpoint

Overview

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

Defined in:

matter/endpoint.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(endpoint_id : DataType::EndpointNumber, device_types : Array(DeviceType) = [] of DeviceType) #

[View source]
def self.new(endpoint_id : DataType::EndpointNumber, device_type : DeviceType) #

Convenience constructor for single device type


[View source]

Instance Method Detail

def add_cluster(cluster : Cluster::Base) #

Add a cluster to this endpoint


[View source]
def cluster_count : Int32 #

Get the number of clusters


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

Get all cluster IDs


[View source]
def clusters : Hash(UInt32, Cluster::Base) #

[View source]
def description : String #

Get a human-readable description of this endpoint


[View source]
def device_types : Array(DeviceType) #

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

[View source]
def get_cluster(cluster_id : UInt32) : Cluster::Base | Nil #

Get a cluster by ID


[View source]
def get_cluster(cluster_type : T.class) : T | Nil forall T #

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


[View source]
def get_cluster!(cluster_id : UInt32) : Cluster::Base #

Get a cluster by ID (raises if not found)


[View source]
def get_cluster!(cluster_type : T.class) : T forall T #

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


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

Check if endpoint has a cluster


[View source]
def 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


[View source]
def primary_device_type : DeviceType | Nil #

Get primary device type


[View source]
def read_attribute(cluster_id : UInt32, attribute_id : UInt32) : InteractionModel::Status | Bytes #

Read an attribute from a cluster on this endpoint


[View source]
def valid? : Bool #

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


[View source]
def validate : Array(String) #

Validate that this endpoint satisfies its device type requirements


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

Write an attribute to a cluster on this endpoint


[View source]