"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var ProxyDiscovery_exports = {};
__export(ProxyDiscovery_exports, {
  ProxyDiscovery: () => ProxyDiscovery
});
module.exports = __toCommonJS(ProxyDiscovery_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const ProxyDiscovery = (0, import_elements.ClusterElement)({
  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: [
    (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
    (0, import_elements.CommandElement)({
      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: [
        (0, import_elements.FieldElement)({
          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" }
        }),
        (0, import_elements.FieldElement)({
          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" }
        }),
        (0, import_elements.FieldElement)({
          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" }
        })
      ]
    }),
    (0, import_elements.CommandElement)({
      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: [
        (0, import_elements.FieldElement)({
          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" }
        }),
        (0, import_elements.FieldElement)({
          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" }
        }),
        (0, import_elements.FieldElement)({
          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" }
        })
      ]
    })
  ]
});
import_MatterDefinition.MatterDefinition.children.push(ProxyDiscovery);
//# sourceMappingURL=ProxyDiscovery.js.map
