MatterEx.DeviceTypes (matter_ex v0.3.1)

Copy Markdown View Source

Matter Device Type registry.

Maps device type IDs to their metadata: name, required server clusters, and optional server clusters. Used by the Descriptor cluster to populate device_type_list and validate cluster requirements.

Reference: Matter Specification, Chapter 9 (Device Library).

Summary

Functions

Get device type definition by ID.

List all known device type IDs.

Get device type name by ID.

Check if a set of cluster IDs satisfies all required clusters for a device type.

Types

device_type()

@type device_type() :: %{
  id: non_neg_integer(),
  name: atom(),
  revision: non_neg_integer(),
  required_clusters: [non_neg_integer()],
  optional_clusters: [non_neg_integer()]
}

Functions

get(device_type_id)

@spec get(non_neg_integer()) :: device_type() | nil

Get device type definition by ID.

list()

@spec list() :: [non_neg_integer()]

List all known device type IDs.

name(device_type_id)

@spec name(non_neg_integer()) :: atom() | nil

Get device type name by ID.

validate(device_type_id, cluster_ids)

@spec validate(non_neg_integer(), [non_neg_integer()]) ::
  :ok | {:error, [non_neg_integer()]}

Check if a set of cluster IDs satisfies all required clusters for a device type.