/**
 * @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,
  CommandElement as Command,
  FieldElement as Field
} from "../../elements/index.js";
const ProxyDiscovery = Cluster({
  name: "ProxyDiscovery",
  id: 67,
  classification: "node",
  pics: "PXDSC",
  details: "This cluster contains commands needed to do proxy discovery as defined in the Section 9.15.7.3, \u201CStep 2: Proxy Discovery\u201D and Section 9.15.7.4, \u201CStep 3: Proxy Response\u201D steps of the overall Section 9.15.7, \u201CProxy Discovery & Assignment Flow\u201D.",
  xref: { document: "core", section: "9.15.12" },
  children: [
    Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
    Command({
      name: "ProxyDiscoverRequest",
      id: 0,
      access: "O",
      conformance: "M",
      direction: "request",
      details: "This command is used during proxy discovery, as specified in Section 9.15.7, \u201CProxy Discovery & Assignment Flow\u201D.",
      xref: { document: "core", section: "9.15.12.4.1" },
      children: [
        Field({
          name: "SourceNodeId",
          id: 0,
          type: "node-id",
          conformance: "M",
          details: "This is the Node ID of the source for which a client seeks to find a Proxy.",
          xref: { document: "core", section: "9.15.12.4.1.1" }
        }),
        Field({
          name: "NumAttributePaths",
          id: 1,
          type: "uint16",
          conformance: "M",
          constraint: "desc",
          details: "The number of attribute paths the client will have in the subscription request. This is a heuristic/hint to allow a Proxy to better ascertain whether it can support the ensuing subscription.",
          xref: { document: "core", section: "9.15.12.4.1.2" }
        }),
        Field({
          name: "NumEventPaths",
          id: 2,
          type: "uint16",
          conformance: "M",
          constraint: "desc",
          details: "The number of event paths the client will have in the subscription request. This is a heuristic/hint to allow a Proxy to better ascertain whether it can support the ensuing subscription.",
          xref: { document: "core", section: "9.15.12.4.1.3" }
        })
      ]
    }),
    Command({
      name: "ProxyDiscoverResponse",
      id: 1,
      conformance: "M",
      direction: "response",
      details: "This command is used during proxy discovery, as specified in Section 9.15.7, \u201CProxy Discovery & Assignment Flow\u201D.",
      xref: { document: "core", section: "9.15.12.4.2" },
      children: [
        Field({
          name: "SourceNodeId",
          id: 0,
          type: "node-id",
          conformance: "M",
          details: "This is the Node ID of the source the proxy can proxy for. This shall match the node id in the corresponding Proxy Discover Request Command message.",
          xref: { document: "core", section: "9.15.12.4.2.1" }
        }),
        Field({
          name: "NumHopsToSource",
          id: 1,
          type: "uint16",
          conformance: "M",
          constraint: "desc",
          details: "If the proxy currently subscribes to the source (either directly or indirectly), this indicates the number of hops to the source. Sensible values start at 1, with 1 being used for a proxy that subscribes directly to the source. If the proxy is not subscribed directly to the source, this value shall be one greater than the NumHopsToSource for the given Node ID of the proxy it is subscribed to.\n0 indicates that the proxy currently does not have a subscription to the source.",
          xref: { document: "core", section: "9.15.12.4.2.2" }
        }),
        Field({
          name: "AvailableCapacity",
          id: 2,
          type: "uint16",
          conformance: "M",
          constraint: "desc",
          details: "A number indicating the number of Cluster Attribute Paths the proxy has space for support. This allows for an absolute comparison of different memory capacities of candidate proxies by the client in selecting the best possible candidate.",
          xref: { document: "core", section: "9.15.12.4.2.3" }
        })
      ]
    })
  ]
});
MatterDefinition.children.push(ProxyDiscovery);
export {
  ProxyDiscovery
};
//# sourceMappingURL=ProxyDiscovery.js.map
