class Matter::MatterNode

Overview

MatterNode represents a complete Matter device with multiple endpoints

Defined in:

matter/endpoint.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add_endpoint(endpoint : Endpoint) #

Add an endpoint to this node


[View source]
def description : String #

Get a human-readable description of this matter node


[View source]
def endpoint_count : Int32 #

Get the number of endpoints


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

Get all endpoint IDs


[View source]
def endpoints : Hash(UInt16, Endpoint) #

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

Get a typed cluster from an endpoint Usage: node.get_cluster(1_u16, OnOffCluster)


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

Get a typed cluster from an endpoint (raises if not found)


[View source]
def get_endpoint(endpoint_id : UInt16) : Endpoint | Nil #

Get an endpoint by ID


[View source]
def get_endpoint!(endpoint_id : UInt16) : Endpoint #

Get an endpoint by ID (raises if not found)


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

Check if node has an endpoint


[View source]
def invoke_command(endpoint_id : UInt16, cluster_id : UInt32, command_id : UInt32, fields : Bytes = Bytes.new(0)) : InteractionModel::Status | Bytes #

Invoke a command on a cluster on an endpoint


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

Read an attribute from a cluster on an endpoint


[View source]
def valid? : Bool #

Check if all endpoints are valid


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

Validate all endpoints


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

Write an attribute to a cluster on an endpoint


[View source]