Get primary device type
class
Matter::Endpoint
- Matter::Endpoint
- Reference
- Object
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.crConstructors
- .new(endpoint_id : DataType::EndpointNumber, device_types : Array(DeviceType) = [] of DeviceType)
-
.new(endpoint_id : DataType::EndpointNumber, device_type : DeviceType)
Convenience constructor for single device type
Instance Method Summary
-
#add_cluster(cluster : Cluster::Base)
Add a cluster to this endpoint
-
#cluster_count : Int32
Get the number of clusters
-
#cluster_ids : Array(UInt32)
Get all cluster IDs
- #clusters : Hash(UInt32, Cluster::Base)
-
#description : String
Get a human-readable description of this endpoint
- #device_types : Array(DeviceType)
- #endpoint_id : DataType::EndpointNumber
-
#get_cluster(cluster_id : UInt32) : Cluster::Base | Nil
Get a cluster by ID
-
#get_cluster(cluster_type : T.class) : T | Nil forall T
Get a typed cluster by class Usage: endpoint.get_cluster(OnOffCluster)
-
#get_cluster!(cluster_id : UInt32) : Cluster::Base
Get a cluster by ID (raises if not found)
-
#get_cluster!(cluster_type : T.class) : T forall T
Get a typed cluster by class (raises if not found)
-
#has_cluster?(cluster_id : UInt32) : Bool
Check if endpoint has a cluster
-
#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
-
#primary_device_type : DeviceType | Nil
Get primary device type
-
#read_attribute(cluster_id : UInt32, attribute_id : UInt32) : InteractionModel::Status | Bytes
Read an attribute from a cluster on this endpoint
-
#valid? : Bool
Check if this endpoint is valid (has all required clusters)
-
#validate : Array(String)
Validate that this endpoint satisfies its device type requirements
-
#write_attribute(cluster_id : UInt32, attribute_id : UInt32, value : Bytes) : InteractionModel::Status
Write an attribute to a cluster on this endpoint
Constructor Detail
Convenience constructor for single device type
Instance Method Detail
Get a typed cluster by class Usage: endpoint.get_cluster(OnOffCluster)
Get a typed cluster by class (raises if not found)
Invoke a command on a cluster on this endpoint
Read an attribute from a cluster on this endpoint
Write an attribute to a cluster on this endpoint