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.
Get device type ID by name.
Returns the built-in device type names accepted by the Device DSL.
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
@type device_type() :: %{ id: non_neg_integer(), name: atom(), revision: non_neg_integer(), required_clusters: [non_neg_integer()], optional_clusters: [non_neg_integer()] }
Functions
@spec get(non_neg_integer()) :: device_type() | nil
Get device type definition by ID.
@spec id_for_name(atom()) :: non_neg_integer() | nil
Get device type ID by name.
@spec known_device_types() :: [{atom(), non_neg_integer()}]
Returns the built-in device type names accepted by the Device DSL.
The returned keyword list is sorted by device type name and maps each friendly DSL name to its Matter device type ID.
@spec list() :: [non_neg_integer()]
List all known device type IDs.
@spec name(non_neg_integer()) :: atom() | nil
Get device type name by ID.
@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.