interface NetworkCommissioningBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<ClusterEvents<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        interfaceEnabled$Changing: ClusterEvents.AttributeObservable<WritableAttribute<boolean, any>>;
        lastConnectErrorValue$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        lastNetworkId$Changing: ClusterEvents.AttributeObservable<Attribute<null | Uint8Array, any>>;
        lastNetworkingStatus$Changing: ClusterEvents.AttributeObservable<Attribute<null | NetworkCommissioning.NetworkCommissioningStatus, any>>;
        maxNetworks$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        networks$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
            connected: FieldType<boolean>;
            networkId: FieldType<Uint8Array>;
        }>[], any>>;
    } & {} & {
        interfaceEnabled$Changed: ClusterEvents.AttributeObservable<WritableAttribute<boolean, any>>;
        lastConnectErrorValue$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        lastNetworkId$Changed: ClusterEvents.AttributeObservable<Attribute<null | Uint8Array, any>>;
        lastNetworkingStatus$Changed: ClusterEvents.AttributeObservable<Attribute<null | NetworkCommissioning.NetworkCommissioningStatus, any>>;
        maxNetworks$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        networks$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
            connected: FieldType<boolean>;
            networkId: FieldType<Uint8Array>;
        }>[], any>>;
    } & {} & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        ethernetNetworkInterface: BitFlag;
        threadNetworkInterface: BitFlag;
        wiFiNetworkInterface: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        interfaceEnabled: boolean;
        lastConnectErrorValue: null | number;
        lastNetworkId: null | Uint8Array;
        lastNetworkingStatus: null | NetworkCommissioning.NetworkCommissioningStatus;
        networks: TypeFromFields<{
            connected: FieldType<boolean>;
            networkId: FieldType<Uint8Array>;
        }>[];
    } & {} & {
        maxNetworks: number;
    } & {};
    [asyncDispose](): MaybePromise;
    asAdmin(fn: (() => void)): void;
    assertAttributeEnabled<This, K>(this: This, attributeName: K): void;
    callback<A, R>(reactor: Reactor<A, R>, options?: Reactor.Options): ((...args: A) => undefined | R);
    initialize(_options?: {}): MaybePromise;
    reactTo<O>(observable: O, reactor: Reactor<Parameters<O["emit"]>, ReturnType<O["emit"]>>, options?: Reactor.Options): void;
    requireAttributeEnabled<This, K>(this: This, attributeName: K): Exclude<This["state"][K], undefined>;
    toString(): string;
    State: any;
}

Hierarchy (view full)

Properties

[reference]: Datasource<StateType>
agent: Agent
cluster: never

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<ClusterEvents<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    interfaceEnabled$Changing: ClusterEvents.AttributeObservable<WritableAttribute<boolean, any>>;
    lastConnectErrorValue$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    lastNetworkId$Changing: ClusterEvents.AttributeObservable<Attribute<null | Uint8Array, any>>;
    lastNetworkingStatus$Changing: ClusterEvents.AttributeObservable<Attribute<null | NetworkCommissioning.NetworkCommissioningStatus, any>>;
    maxNetworks$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    networks$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        connected: FieldType<boolean>;
        networkId: FieldType<Uint8Array>;
    }>[], any>>;
} & {} & {
    interfaceEnabled$Changed: ClusterEvents.AttributeObservable<WritableAttribute<boolean, any>>;
    lastConnectErrorValue$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    lastNetworkId$Changed: ClusterEvents.AttributeObservable<Attribute<null | Uint8Array, any>>;
    lastNetworkingStatus$Changed: ClusterEvents.AttributeObservable<Attribute<null | NetworkCommissioning.NetworkCommissioningStatus, any>>;
    maxNetworks$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    networks$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        connected: FieldType<boolean>;
        networkId: FieldType<Uint8Array>;
    }>[], any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    ethernetNetworkInterface: BitFlag;
    threadNetworkInterface: BitFlag;
    wiFiNetworkInterface: BitFlag;
}>

Supported features as a flag object.

session: SecureSession
state: Omit<ClusterState.Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    interfaceEnabled: boolean;
    lastConnectErrorValue: null | number;
    lastNetworkId: null | Uint8Array;
    lastNetworkingStatus: null | NetworkCommissioning.NetworkCommissioningStatus;
    networks: TypeFromFields<{
        connected: FieldType<boolean>;
        networkId: FieldType<Uint8Array>;
    }>[];
} & {} & {
    maxNetworks: number;
} & {}

Access the behavior's state.

Type declaration

  • ReadonlyinterfaceEnabled: boolean

    Indicates whether the associated network interface is enabled or not. By default all network interfaces SHOULD be enabled during initial commissioning (InterfaceEnabled set to true).

    It is undefined what happens if InterfaceEnabled is written to false on the same interface as that which is used to write the value. In that case, it is possible that the Administrator would have to await expiry of the fail-safe, and associated recovery of network configuration to prior safe values, before being able to communicate with the node again (see Section 11.10.6.2, “ArmFailSafe Command”).

    It may be possible to disable Ethernet interfaces but it is implementation-defined. If not supported, a write to this attribute with a value of false shall fail with a status of INVALID_ACTION. When disabled, an Ethernet interface would longer employ media detection. That is, a simple unplug and replug of the cable shall NOT re-enable the interface.

    On Ethernet-only Nodes, there shall always be at least one of the Network Commissioning server cluster instances with InterfaceEnabled set to true.

    MatterSpecification.v13.Core § 11.9.6.5

  • ReadonlylastConnectErrorValue: null | number

    Indicates the ErrorValue used in the last failed attempt to connect to an operational network, using this interface, whether by invocation of the ConnectNetwork command or by

    autonomous connection after loss of connectivity or during initial establishment. If no such attempt was made, or no network configurations exist in the Networks attribute, then this attribute shall be set to null.

    If the last connection succeeded, as indicated by a value of Success in the LastNetworkingStatus attribute, then this field shall be set to null.

    This attribute is present to assist with error recovery during Network commissioning and to assist in non-concurrent networking commissioning flows.

    MatterSpecification.v13.Core § 11.9.6.8

  • ReadonlylastNetworkId: null | Uint8Array

    Indicates the NetworkID used in the last attempt to connect to an operational network, using this interface, whether by invocation of the ConnectNetwork command or by autonomous connection after loss of connectivity or during initial establishment. If no such attempt was made, or no network configurations exist in the Networks attribute, then this attribute shall be set to null.

    If a network configuration is removed from the Networks attribute using the RemoveNetwork command after a connection attempt, this field may indicate a NetworkID that is no longer configured on the Node.

    This attribute is present to assist with error recovery during Network commissioning and to assist in non-concurrent networking commissioning flows.

    MatterSpecification.v13.Core § 11.9.6.7

  • ReadonlylastNetworkingStatus: null | NetworkCommissioning.NetworkCommissioningStatus

    Indicates the status of the last attempt either scan or connect to an operational network, using this interface, whether by invocation of the ConnectNetwork command or by autonomous connection after loss of connectivity or during initial establishment. If no such attempt was made, or no network configurations exist in the Networks attribute, then this attribute shall be set to null.

    This attribute is present to assist with error recovery during Network commissioning and to assist in non-concurrent networking commissioning flows.

    MatterSpecification.v13.Core § 11.9.6.6

  • Readonlynetworks: TypeFromFields<{
        connected: FieldType<boolean>;
        networkId: FieldType<Uint8Array>;
    }>[]

    Indicates the network configurations that are usable on the network interface represented by this cluster server instance.

    The order of configurations in the list reflects precedence. That is, any time the Node attempts to connect to the network it shall attempt to do so using the configurations in Networks Attribute in the order as they appear in the list.

    The order of list items shall only be modified by the AddOrUpdateThreadNetwork, AddOrUpdateWiFiNetwork and ReorderNetwork commands. In other words, the list shall be stable over time, unless mutated externally.

    Ethernet networks shall be automatically populated by the cluster server. Ethernet Network Commissioning Cluster instances shall always have exactly one NetworkInfoStruct instance in their Networks attribute. There shall be no way to add, update or remove Ethernet network configurations to those Cluster instances.

    MatterSpecification.v13.Core § 11.9.6.2

Type declaration

  • ReadonlymaxNetworks: number

    This shall indicate the maximum number of network configuration entries that can be added, based on available device resources. The length of the Networks attribute shall be less than or equal to this value.

    MatterSpecification.v13.Core § 11.9.6.1

Methods

  • Create a generic callback function that has the same properties as a Reactor.

    Like a reactor, the callback's "this" will be bound to an active Behavior instance. Because of this: The reactor MUST be a real JS function - arrow functions will not work!

    Type Parameters

    • A extends any[]
    • R

    Parameters

    Returns ((...args: A) => undefined | R)

      • (...args): undefined | R
      • Parameters

        • Rest...args: A

        Returns undefined | R

  • Behaviors are ephemeral and should not perform initialization in their constructor. They can override this method instead.

    This method may be synchronous or asyncronous. If asynchronous, the behavior will not be available for external use until initialization completes.

    Parameters

    • Optional_options: {}

      Returns MaybePromise

    • Install a Reactor.

      Important: The reactor MUST be a real JS function - arrow functions will not work!

      Type Parameters

      Parameters

      Returns void