/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  EventElement as Event,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const ThreadNetworkDiagnostics = Cluster(
  { name: "ThreadNetworkDiagnostics", id: 53, classification: "node", quality: "K" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 3 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "PKTCNT", constraint: "0", title: "PacketCounts" }),
    Field({ name: "ERRCNT", constraint: "1", title: "ErrorCounts" }),
    Field({ name: "MLECNT", constraint: "2", title: "MleCounts" }),
    Field({ name: "MACCNT", constraint: "3", title: "MacCounts" })
  ),
  Attribute({ name: "Channel", id: 0, type: "uint16", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "RoutingRole", id: 1, type: "RoutingRoleEnum", access: "R V", conformance: "M", quality: "X" }),
  Attribute({
    name: "NetworkName",
    id: 2,
    type: "string",
    access: "R V",
    conformance: "M",
    constraint: "max 16",
    quality: "X"
  }),
  Attribute({ name: "PanId", id: 3, type: "uint16", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "ExtendedPanId", id: 4, type: "uint64", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "MeshLocalPrefix", id: 5, type: "ipv6pre", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "OverrunCount", id: 6, type: "uint64", access: "R V", conformance: "ERRCNT", default: 0, quality: "C" }),
  Attribute(
    { name: "NeighborTable", id: 7, type: "list", access: "R V", conformance: "M", default: [] },
    Field({ name: "entry", type: "NeighborTableStruct" })
  ),
  Attribute(
    { name: "RouteTable", id: 8, type: "list", access: "R V", conformance: "M", default: [] },
    Field({ name: "entry", type: "RouteTableStruct" })
  ),
  Attribute({ name: "PartitionId", id: 9, type: "uint32", access: "R V", conformance: "M", quality: "X" }),
  Attribute({
    name: "Weighting",
    id: 10,
    type: "uint16",
    access: "R V",
    conformance: "M",
    constraint: "max 255",
    quality: "X"
  }),
  Attribute({
    name: "DataVersion",
    id: 11,
    type: "uint16",
    access: "R V",
    conformance: "M",
    constraint: "max 255",
    quality: "X"
  }),
  Attribute({
    name: "StableDataVersion",
    id: 12,
    type: "uint16",
    access: "R V",
    conformance: "M",
    constraint: "max 255",
    quality: "X"
  }),
  Attribute({
    name: "LeaderRouterId",
    id: 13,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "max 62",
    quality: "X"
  }),
  Attribute({
    name: "DetachedRoleCount",
    id: 14,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "ChildRoleCount",
    id: 15,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RouterRoleCount",
    id: 16,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "LeaderRoleCount",
    id: 17,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "AttachAttemptCount",
    id: 18,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "PartitionIdChangeCount",
    id: 19,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "BetterPartitionAttachAttemptCount",
    id: 20,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "ParentChangeCount",
    id: 21,
    type: "uint16",
    access: "R V",
    conformance: "[MLECNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxTotalCount",
    id: 22,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxUnicastCount",
    id: 23,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxBroadcastCount",
    id: 24,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxAckRequestedCount",
    id: 25,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxAckedCount",
    id: 26,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxNoAckRequestedCount",
    id: 27,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({ name: "TxDataCount", id: 28, type: "uint32", access: "R V", conformance: "[MACCNT]", default: 0, quality: "C" }),
  Attribute({
    name: "TxDataPollCount",
    id: 29,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxBeaconCount",
    id: 30,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxBeaconRequestCount",
    id: 31,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxOtherCount",
    id: 32,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxRetryCount",
    id: 33,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxDirectMaxRetryExpiryCount",
    id: 34,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxIndirectMaxRetryExpiryCount",
    id: 35,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxErrCcaCount",
    id: 36,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxErrAbortCount",
    id: 37,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "TxErrBusyChannelCount",
    id: 38,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxTotalCount",
    id: 39,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxUnicastCount",
    id: 40,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxBroadcastCount",
    id: 41,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({ name: "RxDataCount", id: 42, type: "uint32", access: "R V", conformance: "[MACCNT]", default: 0, quality: "C" }),
  Attribute({
    name: "RxDataPollCount",
    id: 43,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxBeaconCount",
    id: 44,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxBeaconRequestCount",
    id: 45,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxOtherCount",
    id: 46,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxAddressFilteredCount",
    id: 47,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxDestAddrFilteredCount",
    id: 48,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxDuplicatedCount",
    id: 49,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrNoFrameCount",
    id: 50,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrUnknownNeighborCount",
    id: 51,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrInvalidSrcAddrCount",
    id: 52,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrSecCount",
    id: 53,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrFcsCount",
    id: 54,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({
    name: "RxErrOtherCount",
    id: 55,
    type: "uint32",
    access: "R V",
    conformance: "[MACCNT]",
    default: 0,
    quality: "C"
  }),
  Attribute({ name: "ActiveTimestamp", id: 56, type: "uint64", access: "R V", conformance: "O", default: 0, quality: "X" }),
  Attribute({ name: "PendingTimestamp", id: 57, type: "uint64", access: "R V", conformance: "O", default: 0, quality: "X" }),
  Attribute({ name: "Delay", id: 58, type: "uint32", access: "R V", conformance: "O", default: 0, quality: "X" }),
  Attribute({ name: "SecurityPolicy", id: 59, type: "SecurityPolicy", access: "R V", conformance: "M", quality: "X" }),
  Attribute({
    name: "ChannelPage0Mask",
    id: 60,
    type: "octstr",
    access: "R V",
    conformance: "M",
    constraint: "4",
    quality: "X"
  }),
  Attribute({
    name: "OperationalDatasetComponents",
    id: 61,
    type: "OperationalDatasetComponents",
    access: "R V",
    conformance: "M",
    quality: "X"
  }),
  Attribute(
    {
      name: "ActiveNetworkFaultsList",
      id: 62,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "max 4"
    },
    Field({ name: "entry", type: "NetworkFaultEnum" })
  ),
  Attribute({ name: "ExtAddress", id: 63, type: "uint64", access: "R V", conformance: "P, M", quality: "X" }),
  Attribute({ name: "Rloc16", id: 64, type: "uint16", access: "R V", conformance: "P, M", quality: "X" }),
  Event(
    { name: "ConnectionStatus", id: 0, access: "V", conformance: "O", priority: "info" },
    Field({ name: "ConnectionStatus", id: 0, type: "ConnectionStatusEnum", conformance: "M" })
  ),
  Event(
    { name: "NetworkFaultChange", id: 1, access: "V", conformance: "O", priority: "info" },
    Field(
      { name: "Current", id: 0, type: "list", conformance: "M", constraint: "max 4" },
      Field({ name: "entry", type: "NetworkFaultEnum" })
    ),
    Field(
      { name: "Previous", id: 1, type: "list", conformance: "M", constraint: "max 4" },
      Field({ name: "entry", type: "NetworkFaultEnum" })
    )
  ),
  Command({ name: "ResetCounts", id: 0, access: "M", conformance: "ERRCNT", direction: "request", response: "status" }),
  Datatype(
    { name: "NetworkFaultEnum", type: "enum8" },
    Field({ name: "Unspecified", id: 0, conformance: "M" }),
    Field({ name: "LinkDown", id: 1, conformance: "M" }),
    Field({ name: "HardwareFailure", id: 2, conformance: "M" }),
    Field({ name: "NetworkJammed", id: 3, conformance: "M" })
  ),
  Datatype(
    { name: "ConnectionStatusEnum", type: "enum8" },
    Field({ name: "Connected", id: 0, conformance: "M" }),
    Field({ name: "NotConnected", id: 1, conformance: "M" })
  ),
  Datatype(
    { name: "RoutingRoleEnum", type: "enum8" },
    Field({ name: "Unspecified", id: 0, conformance: "M" }),
    Field({ name: "Unassigned", id: 1, conformance: "M" }),
    Field({ name: "SleepyEndDevice", id: 2, conformance: "M" }),
    Field({ name: "EndDevice", id: 3, conformance: "M" }),
    Field({ name: "Reed", id: 4, conformance: "M" }),
    Field({ name: "Router", id: 5, conformance: "M" }),
    Field({ name: "Leader", id: 6, conformance: "M" })
  ),
  Datatype(
    { name: "NeighborTableStruct", type: "struct" },
    Field({ name: "ExtAddress", id: 0, type: "uint64", conformance: "M" }),
    Field({ name: "Age", id: 1, type: "uint32", conformance: "M" }),
    Field({ name: "Rloc16", id: 2, type: "uint16", conformance: "M" }),
    Field({ name: "LinkFrameCounter", id: 3, type: "uint32", conformance: "M" }),
    Field({ name: "MleFrameCounter", id: 4, type: "uint32", conformance: "M" }),
    Field({ name: "Lqi", id: 5, type: "uint8", conformance: "M", constraint: "0 to 255" }),
    Field({
      name: "AverageRssi",
      id: 6,
      type: "int8",
      conformance: "M",
      constraint: "-128 to 0",
      default: null,
      quality: "X"
    }),
    Field({
      name: "LastRssi",
      id: 7,
      type: "int8",
      conformance: "M",
      constraint: "-128 to 0",
      default: null,
      quality: "X"
    }),
    Field({ name: "FrameErrorRate", id: 8, type: "uint8", conformance: "M", constraint: "0 to 100", default: 0 }),
    Field({ name: "MessageErrorRate", id: 9, type: "uint8", conformance: "M", constraint: "0 to 100", default: 0 }),
    Field({ name: "RxOnWhenIdle", id: 10, type: "bool", conformance: "M" }),
    Field({ name: "FullThreadDevice", id: 11, type: "bool", conformance: "M" }),
    Field({ name: "FullNetworkData", id: 12, type: "bool", conformance: "M" }),
    Field({ name: "IsChild", id: 13, type: "bool", conformance: "M" })
  ),
  Datatype(
    { name: "RouteTableStruct", type: "struct" },
    Field({ name: "ExtAddress", id: 0, type: "uint64", conformance: "M" }),
    Field({ name: "Rloc16", id: 1, type: "uint16", conformance: "M" }),
    Field({ name: "RouterId", id: 2, type: "uint8", conformance: "M" }),
    Field({ name: "NextHop", id: 3, type: "uint8", conformance: "M" }),
    Field({ name: "PathCost", id: 4, type: "uint8", conformance: "M" }),
    Field({ name: "LqiIn", id: 5, type: "uint8", conformance: "M" }),
    Field({ name: "LqiOut", id: 6, type: "uint8", conformance: "M" }),
    Field({ name: "Age", id: 7, type: "uint8", conformance: "M" }),
    Field({ name: "Allocated", id: 8, type: "bool", conformance: "M" }),
    Field({ name: "LinkEstablished", id: 9, type: "bool", conformance: "M" })
  ),
  Datatype(
    { name: "SecurityPolicy", type: "struct" },
    Field({ name: "RotationTime", id: 0, type: "uint16", conformance: "M" }),
    Field({ name: "Flags", id: 1, type: "uint16", conformance: "M" })
  ),
  Datatype(
    { name: "OperationalDatasetComponents", type: "struct" },
    Field({ name: "ActiveTimestampPresent", id: 0, type: "bool", conformance: "M" }),
    Field({ name: "PendingTimestampPresent", id: 1, type: "bool", conformance: "M" }),
    Field({ name: "MasterKeyPresent", id: 2, type: "bool", conformance: "M" }),
    Field({ name: "NetworkNamePresent", id: 3, type: "bool", conformance: "M" }),
    Field({ name: "ExtendedPanIdPresent", id: 4, type: "bool", conformance: "M" }),
    Field({ name: "MeshLocalPrefixPresent", id: 5, type: "bool", conformance: "M" }),
    Field({ name: "DelayPresent", id: 6, type: "bool", conformance: "M" }),
    Field({ name: "PanIdPresent", id: 7, type: "bool", conformance: "M" }),
    Field({ name: "ChannelPresent", id: 8, type: "bool", conformance: "M" }),
    Field({ name: "PskcPresent", id: 9, type: "bool", conformance: "M" }),
    Field({ name: "SecurityPolicyPresent", id: 10, type: "bool", conformance: "M" }),
    Field({ name: "ChannelMaskPresent", id: 11, type: "bool", conformance: "M" })
  )
);
MatterDefinition.children.push(ThreadNetworkDiagnostics);
export {
  ThreadNetworkDiagnostics
};
//# sourceMappingURL=thread-network-diagnostics.element.js.map
