/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const Descriptor = Cluster({
  name: "Descriptor",
  id: 29,
  classification: "endpoint",
  pics: "DESC",
  details: "NOTE\nThe Descriptor cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters.\nThis cluster describes an endpoint instance on the node, independently from other endpoints, but also allows composition of endpoints to conform to complex device type patterns.\nThis cluster supports a list of one or more device type identifiers that represent conformance to device type specifications.\nThe cluster supports a PartsList attribute that is a list of zero or more endpoints to support a composed device type.",
  xref: { document: "core", section: "9.5" },
  children: [
    Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
    Attribute({
      name: "FeatureMap",
      id: 65532,
      type: "FeatureMap",
      xref: { document: "core", section: "9.5.4" },
      children: [Field({
        name: "TAGLIST",
        conformance: "desc",
        constraint: "0",
        description: "TagList",
        details: "See the Disambiguation section in the System Model spec for conformance requirements for this feature and the corresponding attribute.",
        xref: { document: "core", section: "9.5.4.1" }
      })]
    }),
    Attribute({
      name: "DeviceTypeList",
      id: 0,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "min 1",
      quality: "F",
      details: "This is a list of device types and corresponding revisions declaring endpoint conformance (see DeviceTypeStruct). At least one device type entry shall be present.\nAn endpoint shall conform to all device types listed in the DeviceTypeList. A cluster instance that is in common for more than one device type in the DeviceTypeList shall be supported as a shared cluster instance on the endpoint.",
      xref: { document: "core", section: "9.5.6.1" },
      children: [Field({ name: "entry", type: "DeviceTypeStruct" })]
    }),
    Attribute({
      name: "ServerList",
      id: 1,
      type: "list",
      access: "R V",
      conformance: "M",
      default: [],
      quality: "F",
      details: "This attribute shall list each cluster ID for the server clusters present on the endpoint instance.",
      xref: { document: "core", section: "9.5.6.2" },
      children: [Field({ name: "entry", type: "cluster-id" })]
    }),
    Attribute({
      name: "ClientList",
      id: 2,
      type: "list",
      access: "R V",
      conformance: "M",
      default: [],
      quality: "F",
      details: "This attribute shall list each cluster ID for the client clusters present on the endpoint instance.",
      xref: { document: "core", section: "9.5.6.3" },
      children: [Field({ name: "entry", type: "cluster-id" })]
    }),
    Attribute({
      name: "PartsList",
      id: 3,
      type: "list",
      access: "R V",
      conformance: "M",
      default: [],
      details: "This attribute indicates composition of the device type instance. Device type instance composition shall include the endpoints in this list.\nSee Endpoint Composition for more information about which endpoints to include in this list.",
      xref: { document: "core", section: "9.5.6.4" },
      children: [Field({ name: "entry", type: "endpoint-no" })]
    }),
    Attribute({
      name: "TagList",
      id: 4,
      type: "list",
      access: "R V",
      conformance: "TAGLIST",
      constraint: "1 to 6",
      quality: "F",
      details: "This attribute shall be used to disambiguate sibling endpoints in certain situations, as defined in the Disambiguation section in the System Model specification. An example of such a situation might be a device with two buttons, with this attribute being used to indicate which of the two endpoints corresponds to the button on the left side.\nIt may also be used to provide information about an endpoint (e.g. the relative location of a Temperature sensor in a Temperature Controlled Cabinet).\n  \u2022 A client SHOULD use these tags to convey disambiguation information and other relevant     information to the user (e.g. showing it in a user interface), as appropriate.\n  \u2022 A client SHOULD use these tags in its logic to make decisions, as appropriate.\nFor example, a client may identify which endpoint maps to a certain function, orientation or labeling.\nA client may use the Label field of each SemanticTagStruct, if present in each structure, to indicate characteristics of an endpoint, or to augment what is provided in the TagID field of the same structure.",
      xref: { document: "core", section: "9.5.6.5" },
      children: [Field({ name: "entry", type: "semtag" })]
    }),
    Datatype({
      name: "DeviceTypeStruct",
      type: "struct",
      details: "The device type and revision define endpoint conformance to a release of a device type definition. See the Data Model specification for more information.",
      xref: { document: "core", section: "9.5.5.1" },
      children: [
        Field({
          name: "DeviceType",
          id: 0,
          type: "devtype-id",
          conformance: "M",
          details: "This shall indicate the device type definition. The endpoint shall conform to the device type definition and cluster specifications required by the device type.",
          xref: { document: "core", section: "9.5.5.1.1" }
        }),
        Field({
          name: "Revision",
          id: 1,
          type: "uint16",
          conformance: "M",
          constraint: "min 1",
          details: "This is the implemented revision of the device type definition. The endpoint shall conform to this revision of the device type.",
          xref: { document: "core", section: "9.5.5.1.2" }
        })
      ]
    })
  ]
});
MatterDefinition.children.push(Descriptor);
export {
  Descriptor
};
//# sourceMappingURL=Descriptor.js.map
