/**
 * @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,
  EventElement as Event,
  FieldElement as Field,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const BasicInformation = Cluster({
  name: "BasicInformation",
  id: 40,
  classification: "node",
  pics: "BINFO",
  details: "This cluster provides attributes and events for determining basic information about Nodes, which supports both Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node.",
  xref: { document: "core", section: "11.1" },
  children: [
    Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 3 }),
    Attribute({
      name: "DataModelRevision",
      id: 0,
      type: "uint16",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      quality: "F",
      details: "This attribute shall be set to the revision number of the Data Model against which the Node is certified. The value of this attribute shall be one of the valid values listed in Section 7.1.1, \u201CRevision History\u201D.",
      xref: { document: "core", section: "11.1.5.1" }
    }),
    Attribute({
      name: "VendorName",
      id: 1,
      type: "string",
      access: "R V",
      conformance: "M",
      constraint: "max 32",
      quality: "F",
      details: "This attribute shall specify a human readable (displayable) name of the vendor for the Node.",
      xref: { document: "core", section: "11.1.5.2" }
    }),
    Attribute({
      name: "VendorId",
      id: 2,
      type: "vendor-id",
      access: "R V",
      conformance: "M",
      quality: "F",
      details: "This attribute shall specify the Vendor ID.",
      xref: { document: "core", section: "11.1.5.3" }
    }),
    Attribute({
      name: "ProductName",
      id: 3,
      type: "string",
      access: "R V",
      conformance: "M",
      constraint: "max 32",
      quality: "F",
      details: "This attribute shall specify a human readable (displayable) name of the model for the Node such as the model number (or other identifier) assigned by the vendor.",
      xref: { document: "core", section: "11.1.5.4" }
    }),
    Attribute({
      name: "ProductId",
      id: 4,
      type: "uint16",
      access: "R V",
      conformance: "M",
      quality: "F",
      details: "This attribute shall specify the Product ID assigned by the vendor that is unique to the specific product of the Node.",
      xref: { document: "core", section: "11.1.5.5" }
    }),
    Attribute({
      name: "NodeLabel",
      id: 5,
      type: "string",
      access: "RW VM",
      conformance: "M",
      constraint: "max 32",
      default: "",
      quality: "N",
      details: "Indicates a user defined name for the Node. This attribute SHOULD be set during initial commissioning and may be updated by further reconfigurations.",
      xref: { document: "core", section: "11.1.5.6" }
    }),
    Attribute({
      name: "Location",
      id: 6,
      type: "string",
      access: "RW VA",
      conformance: "M",
      constraint: "2",
      default: "XX",
      quality: "N",
      details: "This attribute shall be an ISO 3166-1 alpha-2 code to represent the country, dependent territory, or special area of geographic interest in which the Node is located at the time of the attribute being set. This attribute shall be set during initial commissioning (unless already set) and may be updated by further reconfigurations. This attribute may affect some regulatory aspects of the Node\u2019s operation, such as radio transmission power levels in given spectrum allocation bands if technologies where this is applicable are used. The Location\u2019s region code shall be interpreted in a case-insensitive manner. If the Node cannot understand the location code with which it was configured, or the location code has not yet been configured, it shall configure itself in a region- agnostic manner as determined by the vendor, avoiding region-specific assumptions as much as is practical. The special value XX shall indicate that region-agnostic mode is used.",
      xref: { document: "core", section: "11.1.5.7" }
    }),
    Attribute({
      name: "HardwareVersion",
      id: 7,
      type: "uint16",
      access: "R V",
      conformance: "M",
      default: 0,
      quality: "F",
      details: "This attribute shall specify the version number of the hardware of the Node. The meaning of its value, and the versioning scheme, are vendor defined.",
      xref: { document: "core", section: "11.1.5.8" }
    }),
    Attribute({
      name: "HardwareVersionString",
      id: 8,
      type: "string",
      access: "R V",
      conformance: "M",
      constraint: "1 to 64",
      quality: "F",
      details: "This attribute shall specify the version number of the hardware of the Node. The meaning of its value, and the versioning scheme, are vendor defined. The HardwareVersionString attribute shall be used to provide a more user-friendly value than that represented by the HardwareVersion attribute.",
      xref: { document: "core", section: "11.1.5.9" }
    }),
    Attribute({
      name: "SoftwareVersion",
      id: 9,
      type: "uint32",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      default: 0,
      quality: "F",
      details: "This attribute shall contain the current version number for the software running on this Node.\nThe version number can be compared using a total ordering to determine if a version is logically newer than another one. A larger value of SoftwareVersion is newer than a lower value, from the perspective of software updates (see Section 11.20.3.3, \u201CAvailability of Software Images\u201D). Nodes may query this field to determine the currently running version of software on another given Node.",
      xref: { document: "core", section: "11.1.5.10" }
    }),
    Attribute({
      name: "SoftwareVersionString",
      id: 10,
      type: "string",
      access: "R V",
      conformance: "M",
      constraint: "1 to 64",
      quality: "F",
      details: 'This attribute shall contain a current human-readable representation for the software running on the Node. This version information may be conveyed to users. The maximum length of the SoftwareVersionString attribute is 64 bytes of UTF-8 characters. The contents SHOULD only use simple 7-bit ASCII alphanumeric and punctuation characters, so as to simplify the conveyance of the value to a variety of cultures.\nExamples of version strings include "1.0", "1.2.3456", "1.2-2", "1.0b123", "1.2_3".',
      xref: { document: "core", section: "11.1.5.11" }
    }),
    Attribute({
      name: "ManufacturingDate",
      id: 11,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "8 to 16",
      quality: "F",
      details: "This attribute shall specify the date that the Node was manufactured. The first 8 characters shall specify the date of manufacture of the Node in international date notation according to ISO 8601, i.e., YYYYMMDD, e.g., 20060814. The final 8 characters may include country, factory, line, shift or other related information at the option of the vendor. The format of this information is vendor defined.",
      xref: { document: "core", section: "11.1.5.12" }
    }),
    Attribute({
      name: "PartNumber",
      id: 12,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "max 32",
      quality: "F",
      details: "This attribute shall specify a human-readable (displayable) vendor assigned part number for the Node whose meaning and numbering scheme is vendor defined.\nMultiple products (and hence PartNumbers) can share a ProductID. For instance, there may be different packaging (with different PartNumbers) for different regions; also different colors of a product might share the ProductID but may have a different PartNumber.",
      xref: { document: "core", section: "11.1.5.13" }
    }),
    Attribute({
      name: "ProductUrl",
      id: 13,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "max 256",
      quality: "F",
      details: "This attribute shall specify a link to a product specific web page. The syntax of the ProductURL attribute shall follow the syntax as specified in RFC 3986 [https://tools.ietf.org/html/rfc3986]. The specified URL SHOULD resolve to a maintained web page available for the lifetime of the product. The maximum length of the ProductUrl attribute is 256 ASCII characters.",
      xref: { document: "core", section: "11.1.5.14" }
    }),
    Attribute({
      name: "ProductLabel",
      id: 14,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "max 64",
      quality: "F",
      details: "This attribute shall specify a vendor specific human readable (displayable) product label. The ProductLabel attribute may be used to provide a more user-friendly value than that represented by the ProductName attribute. The ProductLabel attribute SHOULD NOT include the name of the vendor as defined within the VendorName attribute.",
      xref: { document: "core", section: "11.1.5.15" }
    }),
    Attribute({
      name: "SerialNumber",
      id: 15,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "max 32",
      quality: "F",
      details: "This attribute shall specify a human readable (displayable) serial number.",
      xref: { document: "core", section: "11.1.5.16" }
    }),
    Attribute({
      name: "LocalConfigDisabled",
      id: 16,
      type: "bool",
      access: "RW VM",
      conformance: "O",
      default: false,
      quality: "N",
      details: "This attribute shall allow a local Node configuration to be disabled. When this attribute is set to True the Node shall disable the ability to configure the Node through an on-Node user interface. The value of the LocalConfigDisabled attribute shall NOT in any way modify, disable, or otherwise affect the user\u2019s ability to trigger a factory reset on the Node.",
      xref: { document: "core", section: "11.1.5.17" }
    }),
    Attribute({
      name: "Reachable",
      id: 17,
      type: "bool",
      access: "R V",
      conformance: "O",
      default: true,
      details: "This attribute (when used) shall indicate whether the Node can be reached. For a native Node this is implicitly True (and its use is optional).\nIts main use case is in the derived Bridged Device Basic Information cluster where it is used to indicate whether the bridged device is reachable by the bridge over the non-native network.",
      xref: { document: "core", section: "11.1.5.18" }
    }),
    Attribute({
      name: "UniqueId",
      id: 18,
      type: "string",
      access: "R V",
      conformance: "O",
      constraint: "max 32",
      quality: "F",
      details: "This attribute (when used) shall indicate a unique identifier for the device, which is constructed in a manufacturer specific manner.\nIt may be constructed using a permanent device identifier (such as device MAC address) as basis. In order to prevent tracking,\n  \u2022 it SHOULD NOT be identical to (or easily derived from) such permanent device identifier\n  \u2022 it SHOULD be updated when the device is factory reset\n  \u2022 it shall not be identical to the SerialNumber attribute\n  \u2022 it shall not be printed on the product or delivered with the product The value does not need to     be human readable.",
      xref: { document: "core", section: "11.1.5.19" }
    }),
    Attribute({
      name: "CapabilityMinima",
      id: 19,
      type: "CapabilityMinimaStruct",
      access: "R V",
      conformance: "M",
      quality: "F",
      details: "This attribute shall provide the minimum guaranteed value for some system-wide resource capabilities that are not otherwise cluster-specific and do not appear elsewhere. This attribute may be used by clients to optimize communication with Nodes by allowing them to use more than the strict minimum values required by this specification, wherever available.\nThe values supported by the server in reality may be larger than the values provided in this attribute, such as if a server is not resource-constrained at all. However, clients SHOULD only rely on the amounts provided in this attribute.\nNote that since the fixed values within this attribute may change over time, both increasing and decreasing, as software versions change for a given Node, clients SHOULD take care not to assume forever unchanging values and SHOULD NOT cache this value permanently at Commissioning time.",
      xref: { document: "core", section: "11.1.5.20" }
    }),
    Attribute({
      name: "ProductAppearance",
      id: 20,
      type: "ProductAppearanceStruct",
      access: "R V",
      conformance: "O",
      quality: "F",
      details: "This attribute shall provide information about the appearance of the product, which could be useful to a user trying to locate or identify the node.",
      xref: { document: "core", section: "11.1.5.21" }
    }),
    Attribute({
      name: "SpecificationVersion",
      id: 21,
      type: "uint32",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      default: 0,
      quality: "F",
      details: "This attribute shall contain the current version number for the specification version this Node was certified against. The version number can be compared using a total ordering to determine if a version is logically newer than another one. A larger value of SpecificationVersion is newer than a lower value.\nNodes may query this field to determine the currently supported version of the specification on another given Node.\nThe format of this number is segmented as its four component bytes. Bit positions for the fields are as follows:\nFor example, a SpecificationVersion value of 0x0102AA00 is composed of 4 version components, representing a version 1.2.170.0.\nIn the example above:\n  \u2022 Major version is the uppermost byte (0x01).\n  \u2022 Minor version is the following byte (0x02).\n  \u2022 Patch version is 170/0xAA.\n  \u2022 Reserved1 value is 0.\nThe initial revision (1.0) of this specification (1.0) was 0x01000000. Matter Spring 2024 release (1.3) was 0x01030000.\nIf the SpecificationVersion is absent or zero, such as in Basic Information cluster revisions prior to Revision 3, the specification version cannot be properly inferred unless other heuristics are employed.\nComparison of SpecificationVersion shall always include the total value over 32 bits, without masking reserved parts.",
      xref: { document: "core", section: "11.1.5.22" }
    }),
    Attribute({
      name: "MaxPathsPerInvoke",
      id: 22,
      type: "uint16",
      access: "R V",
      conformance: "M",
      constraint: "min 1",
      default: 1,
      quality: "F",
      details: "Indicates the maximum number of elements in a single InvokeRequests list (see Section 8.8.2, \u201CInvoke Request Action\u201D) that the Node is able to process. Note that since this attribute may change over time, both increasing and decreasing, as software versions change for a given Node, clients SHOULD take care not to assume forever unchanging values and SHOULD NOT\ncache this value permanently at Commissioning time.\nIf the MaxPathsPerInvoke attribute is absent or zero, such as in Basic Information cluster revisions prior to Revision 3, clients shall assume a value of 1.",
      xref: { document: "core", section: "11.1.5.23" }
    }),
    Event({
      name: "StartUp",
      id: 0,
      access: "V",
      conformance: "M",
      priority: "critical",
      details: "The StartUp event shall be generated by a Node as soon as reasonable after completing a boot or reboot process. The StartUp event SHOULD be the first Data Model event recorded by the Node after it completes a boot or reboot process.",
      xref: { document: "core", section: "11.1.6.1" },
      children: [Field({
        name: "SoftwareVersion",
        id: 0,
        type: "uint32",
        conformance: "M",
        details: "This field shall be set to the same value as the one available in the SoftwareVersion attribute.",
        xref: { document: "core", section: "11.1.6.1.1" }
      })]
    }),
    Event({
      name: "ShutDown",
      id: 1,
      access: "V",
      conformance: "O",
      priority: "critical",
      details: "The ShutDown event SHOULD be generated by a Node prior to any orderly shutdown sequence on a best-effort basis. When a ShutDown event is generated, it SHOULD be the last Data Model event recorded by the Node. This event SHOULD be delivered urgently to current subscribers on a best- effort basis. Any subsequent incoming interactions to the Node may be dropped until the completion of a future boot or reboot process.",
      xref: { document: "core", section: "11.1.6.2" }
    }),
    Event({
      name: "Leave",
      id: 2,
      access: "V",
      conformance: "O",
      priority: "info",
      details: "The Leave event SHOULD be generated by a Node prior to permanently leaving a given Fabric, such as when the RemoveFabric command is invoked for a given fabric, or triggered by factory reset or some other manufacturer specific action to disable or reset the operational data in the Node. When a Leave event is generated, it SHOULD be assumed that the fabric recorded in the event is no longer usable, and subsequent interactions targeting that fabric will most likely fail.\nUpon receipt of Leave Event on a subscription, the receiving Node may update other nodes in the\nfabric by removing related bindings, access control list entries and other data referencing the leaving Node.",
      xref: { document: "core", section: "11.1.6.3" },
      children: [Field({
        name: "FabricIndex",
        id: 0,
        type: "fabric-idx",
        conformance: "M",
        constraint: "1 to 254",
        details: "This field shall contain the local Fabric Index of the fabric which the node is about to leave.",
        xref: { document: "core", section: "11.1.6.3.1" }
      })]
    }),
    Event({
      name: "ReachableChanged",
      id: 3,
      access: "V",
      conformance: "desc",
      priority: "info",
      details: "This event shall be supported if and only if the Reachable attribute is supported.\nThis event (when supported) shall be generated when there is a change in the Reachable attribute.\nIts main use case is in the derived Bridged Device Basic Information cluster.",
      xref: { document: "core", section: "11.1.6.4" },
      children: [Field({
        name: "ReachableNewValue",
        id: 0,
        type: "bool",
        conformance: "M",
        details: "This field shall indicate the value of the Reachable attribute after it was changed.",
        xref: { document: "core", section: "11.1.6.4.1" }
      })]
    }),
    Datatype({
      name: "ProductFinishEnum",
      type: "enum8",
      details: "The data type of ProductFinishEnum is derived from enum8.",
      xref: { document: "core", section: "11.1.4.1" },
      children: [
        Field({
          name: "Other",
          id: 0,
          conformance: "M",
          description: "Product has some other finish not listed below."
        }),
        Field({ name: "Matte", id: 1, conformance: "M", description: "Product has a matte finish." }),
        Field({ name: "Satin", id: 2, conformance: "M", description: "Product has a satin finish." }),
        Field({
          name: "Polished",
          id: 3,
          conformance: "M",
          description: "Product has a polished or shiny finish."
        }),
        Field({ name: "Rugged", id: 4, conformance: "M", description: "Product has a rugged finish." }),
        Field({ name: "Fabric", id: 5, conformance: "M", description: "Product has a fabric finish." })
      ]
    }),
    Datatype({
      name: "ColorEnum",
      type: "enum8",
      details: "The data type of ColorEnum is derived from enum8.",
      xref: { document: "core", section: "11.1.4.2" },
      children: [
        Field({ name: "Black", id: 0, conformance: "M", description: "Approximately RGB #000000." }),
        Field({ name: "Navy", id: 1, conformance: "M", description: "Approximately RGB #000080." }),
        Field({ name: "Green", id: 2, conformance: "M", description: "Approximately RGB #008000." }),
        Field({ name: "Teal", id: 3, conformance: "M", description: "Approximately RGB #008080." }),
        Field({ name: "Maroon", id: 4, conformance: "M", description: "Approximately RGB #800080." }),
        Field({ name: "Purple", id: 5, conformance: "M", description: "Approximately RGB #800080." }),
        Field({ name: "Olive", id: 6, conformance: "M", description: "Approximately RGB #808000." }),
        Field({ name: "Gray", id: 7, conformance: "M", description: "Approximately RGB #808080." }),
        Field({ name: "Blue", id: 8, conformance: "M", description: "Approximately RGB #0000FF." }),
        Field({ name: "Lime", id: 9, conformance: "M", description: "Approximately RGB #00FF00." }),
        Field({ name: "Aqua", id: 10, conformance: "M", description: "Approximately RGB #00FFFF." }),
        Field({ name: "Red", id: 11, conformance: "M", description: "Approximately RGB #FF0000." }),
        Field({ name: "Fuchsia", id: 12, conformance: "M", description: "Approximately RGB #FF00FF." }),
        Field({ name: "Yellow", id: 13, conformance: "M", description: "Approximately RGB #FFFF00." }),
        Field({ name: "White", id: 14, conformance: "M", description: "Approximately RGB #FFFFFF." }),
        Field({ name: "Nickel", id: 15, conformance: "M", description: 'Typical hardware "Nickel" color.' }),
        Field({ name: "Chrome", id: 16, conformance: "M", description: 'Typical hardware "Chrome" color.' }),
        Field({ name: "Brass", id: 17, conformance: "M", description: 'Typical hardware "Brass" color.' }),
        Field({ name: "Copper", id: 18, conformance: "M", description: 'Typical hardware "Copper" color.' }),
        Field({ name: "Silver", id: 19, conformance: "M", description: 'Typical hardware "Silver" color.' }),
        Field({ name: "Gold", id: 20, conformance: "M", description: 'Typical hardware "Gold" color.' })
      ]
    }),
    Datatype({
      name: "ProductAppearanceStruct",
      type: "struct",
      details: "This structure provides a description of the product\u2019s appearance.",
      xref: { document: "core", section: "11.1.4.3" },
      children: [
        Field({
          name: "Finish",
          id: 0,
          type: "ProductFinishEnum",
          conformance: "M",
          details: "This field shall indicate the visible finish of the product.",
          xref: { document: "core", section: "11.1.4.3.1" }
        }),
        Field({
          name: "PrimaryColor",
          id: 1,
          type: "ColorEnum",
          conformance: "M",
          quality: "X",
          details: "This field indicates the representative color of the visible parts of the product. If the product has no representative color, the field shall be null.",
          xref: { document: "core", section: "11.1.4.3.2" }
        })
      ]
    }),
    Datatype({
      name: "CapabilityMinimaStruct",
      type: "struct",
      details: "This structure provides constant values related to overall global capabilities of this Node, that are not cluster-specific.",
      xref: { document: "core", section: "11.1.4.4" },
      children: [
        Field({
          name: "CaseSessionsPerFabric",
          id: 0,
          type: "uint16",
          conformance: "M",
          constraint: "min 3",
          default: 3,
          details: "This field shall indicate the actual minimum number of concurrent CASE sessions that are supported per fabric.\nThis value shall NOT be smaller than the required minimum indicated in Section 4.14.2.8, \u201CMinimal Number of CASE Sessions\u201D.",
          xref: { document: "core", section: "11.1.4.4.1" }
        }),
        Field({
          name: "SubscriptionsPerFabric",
          id: 1,
          type: "uint16",
          conformance: "M",
          constraint: "min 3",
          default: 3,
          details: "This field shall indicate the actual minimum number of concurrent subscriptions supported per fabric.\nThis value shall NOT be smaller than the required minimum indicated in Section 8.5.1, \u201CSubscribe Transaction\u201D.",
          xref: { document: "core", section: "11.1.4.4.2" }
        })
      ]
    })
  ]
});
MatterDefinition.children.push(BasicInformation);
export {
  BasicInformation
};
//# sourceMappingURL=BasicInformation.js.map
