/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Behavior } from "#behavior/Behavior.js"; import { SharedEnvironmentServices } from "@matter/general"; import { MatterModel } from "@matter/model"; import { CommissionableMdnsScanner, FabricAuthorityConfiguration, PeerAddress } from "@matter/protocol"; import { CaseAuthenticatedTag, FabricId, FabricIndex, NodeId } from "@matter/types"; /** * Node controller functionality. * * For our purposes, a "controller" is a node that supports commissioning of remote devices. * * This class initializes components required for controller usage and tracks active discoveries. Discovery logic * resides in {@link Discovery} and commissioning logic in {@link CommissioningClient}. */ export declare class ControllerBehavior extends Behavior { #private; static readonly id = "controller"; internal: ControllerBehavior.Internal; readonly state: ControllerBehavior.State; initialize(): Promise; /** * Allocate a new node address in the given fabric. * * How long an allocated address goes on naming the same device, which anything persisting one has to know: * * - While the peer is commissioned, the address is its own. Every candidate is checked against * {@link IdentityService.peerAddressInUse}, which covers commissioned peers, the controller's own node * IDs, and addresses reserved for a commissioning under way. * - Once the peer is removed, that check no longer holds the address, so a random draw or a node ID the * caller supplies may be the one a removed peer had. * - The `"sequential"` counter only counts up and is stored, so it never hands out a value it has already * handed out. It skips a value that is in use when it arrives at it, and moves past it for good. A * caller-supplied ID does not advance the counter, so the counter reaches that value later: it skips it * while that peer is commissioned, and issues it to another device if the peer is gone by then. */ allocatePeerAddress(fabricIndex: FabricIndex, nodeId?: NodeId): Promise; [Symbol.asyncDispose](): Promise; get fabricAuthorityConfig(): FabricAuthorityConfiguration; } export declare namespace ControllerBehavior { class Internal { services?: SharedEnvironmentServices; scanner?: CommissionableMdnsScanner; } class State { /** * Set to false to disable scanning on BLE. * * By default the controller scans via BLE if BLE is available. */ ble?: boolean; /** * Set to false to disable scanning on IP networks. * * By default the controller always scans on IP networks. */ ip?: boolean; /** * Node ID assignment strategy. */ nodeIdAssignment: "sequential" | "random"; /** * Next assigned ID when {@link nodeIdAssignment} is "sequential". * * matter.js increments this value automatically after allocating a new node ID. This means that the * "sequential" strategy does not reuse IDs from decommissioned nodes. * * If there is a conflict with an existing ID, matter.js increments this value until it identifies a free ID. */ nextNodeId?: NodeId; /** * Contains the label of the admin fabric which is set for all commissioned devices */ adminFabricLabel: string; /** * Contains the FabricId of the admin fabric when a defined number needs to be used because special Certificates * are used. * If not provided, a random FabricId will be generated. */ adminFabricId?: FabricId; /** * Contains the NodeId of the admin node when a defined number needs to be used because special Certificates * are used. * If not provided, a random NodeId will be generated. */ adminNodeId?: NodeId; /** * Case Authenticated Tags to be used to commission and connect to devices. */ caseAuthenticatedTags?: CaseAuthenticatedTag[]; /** * Model of Matter semantics used for peers commissioned or discovered by this controller. * * Supply a model extended with custom or manufacturer-specific clusters (see {@link MatterModel.withClusters}) so * their attributes and commands resolve to real names instead of synthetic `attr$…`/`command$…` identifiers. */ matter?: MatterModel; } } //# sourceMappingURL=ControllerBehavior.d.ts.map