interface GeneralDiagnosticsBehavior {
    [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> & {
        networkInterfaces$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
            hardwareAddress: FieldType<Uint8Array>;
            iPv4Addresses: FieldType<Uint8Array[]>;
            iPv6Addresses: FieldType<Uint8Array[]>;
            isOperational: FieldType<boolean>;
            name: FieldType<string>;
            offPremiseServicesReachableIPv4: FieldType<null | boolean>;
            offPremiseServicesReachableIPv6: FieldType<null | boolean>;
            type: FieldType<GeneralDiagnostics.InterfaceType>;
        }>[], any>>;
        rebootCount$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        testEventTriggersEnabled$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        upTime$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    } & {
        activeHardwareFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.HardwareFault[], any>>;
        activeNetworkFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.NetworkFault[], any>>;
        activeRadioFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.RadioFault[], any>>;
        bootReason$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.BootReason, any>>;
        totalOperationalHours$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    } & {
        networkInterfaces$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
            hardwareAddress: FieldType<Uint8Array>;
            iPv4Addresses: FieldType<Uint8Array[]>;
            iPv6Addresses: FieldType<Uint8Array[]>;
            isOperational: FieldType<boolean>;
            name: FieldType<string>;
            offPremiseServicesReachableIPv4: FieldType<null | boolean>;
            offPremiseServicesReachableIPv6: FieldType<null | boolean>;
            type: FieldType<GeneralDiagnostics.InterfaceType>;
        }>[], any>>;
        rebootCount$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        testEventTriggersEnabled$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        upTime$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    } & {
        activeHardwareFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.HardwareFault[], any>>;
        activeNetworkFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.NetworkFault[], any>>;
        activeRadioFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.RadioFault[], any>>;
        bootReason$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.BootReason, any>>;
        totalOperationalHours$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    } & {
        bootReason: ClusterEvents.EventObservable<Event<TypeFromFields<{
            bootReason: FieldType<GeneralDiagnostics.BootReason>;
        }>, any>>;
    } & {
        hardwareFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
            current: FieldType<GeneralDiagnostics.HardwareFault[]>;
            previous: FieldType<GeneralDiagnostics.HardwareFault[]>;
        }>, any>>;
        networkFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
            current: FieldType<GeneralDiagnostics.NetworkFault[]>;
            previous: FieldType<GeneralDiagnostics.NetworkFault[]>;
        }>, any>>;
        radioFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
            current: FieldType<GeneralDiagnostics.RadioFault[]>;
            previous: FieldType<GeneralDiagnostics.RadioFault[]>;
        }>, any>>;
    };
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        dataModelTest: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        networkInterfaces: TypeFromFields<{
            hardwareAddress: FieldType<Uint8Array>;
            iPv4Addresses: FieldType<Uint8Array[]>;
            iPv6Addresses: FieldType<Uint8Array[]>;
            isOperational: FieldType<boolean>;
            name: FieldType<string>;
            offPremiseServicesReachableIPv4: FieldType<null | boolean>;
            offPremiseServicesReachableIPv6: FieldType<null | boolean>;
            type: FieldType<GeneralDiagnostics.InterfaceType>;
        }>[];
        rebootCount: number;
        testEventTriggersEnabled: boolean;
        upTime: number | bigint;
    } & {
        activeHardwareFaults?: GeneralDiagnostics.HardwareFault[];
        activeNetworkFaults?: GeneralDiagnostics.NetworkFault[];
        activeRadioFaults?: GeneralDiagnostics.RadioFault[];
        bootReason?: GeneralDiagnostics.BootReason;
        totalOperationalHours?: 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>;
    testEventTrigger(request: GeneralDiagnostics.TestEventTriggerRequest): MaybePromise;
    timeSnapshot(): MaybePromise<GeneralDiagnostics.TimeSnapshotResponse>;
    toString(): string;
    State: any;
}

Hierarchy

  • GeneralDiagnosticsBehaviorType
    • GeneralDiagnosticsBehavior

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> & {
    networkInterfaces$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        hardwareAddress: FieldType<Uint8Array>;
        iPv4Addresses: FieldType<Uint8Array[]>;
        iPv6Addresses: FieldType<Uint8Array[]>;
        isOperational: FieldType<boolean>;
        name: FieldType<string>;
        offPremiseServicesReachableIPv4: FieldType<null | boolean>;
        offPremiseServicesReachableIPv6: FieldType<null | boolean>;
        type: FieldType<GeneralDiagnostics.InterfaceType>;
    }>[], any>>;
    rebootCount$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    testEventTriggersEnabled$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    upTime$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
} & {
    activeHardwareFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.HardwareFault[], any>>;
    activeNetworkFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.NetworkFault[], any>>;
    activeRadioFaults$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.RadioFault[], any>>;
    bootReason$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.BootReason, any>>;
    totalOperationalHours$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
} & {
    networkInterfaces$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        hardwareAddress: FieldType<Uint8Array>;
        iPv4Addresses: FieldType<Uint8Array[]>;
        iPv6Addresses: FieldType<Uint8Array[]>;
        isOperational: FieldType<boolean>;
        name: FieldType<string>;
        offPremiseServicesReachableIPv4: FieldType<null | boolean>;
        offPremiseServicesReachableIPv6: FieldType<null | boolean>;
        type: FieldType<GeneralDiagnostics.InterfaceType>;
    }>[], any>>;
    rebootCount$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    testEventTriggersEnabled$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    upTime$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
} & {
    activeHardwareFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.HardwareFault[], any>>;
    activeNetworkFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.NetworkFault[], any>>;
    activeRadioFaults$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.RadioFault[], any>>;
    bootReason$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<GeneralDiagnostics.BootReason, any>>;
    totalOperationalHours$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
} & {
    bootReason: ClusterEvents.EventObservable<Event<TypeFromFields<{
        bootReason: FieldType<GeneralDiagnostics.BootReason>;
    }>, any>>;
} & {
    hardwareFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        current: FieldType<GeneralDiagnostics.HardwareFault[]>;
        previous: FieldType<GeneralDiagnostics.HardwareFault[]>;
    }>, any>>;
    networkFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        current: FieldType<GeneralDiagnostics.NetworkFault[]>;
        previous: FieldType<GeneralDiagnostics.NetworkFault[]>;
    }>, any>>;
    radioFaultChange?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        current: FieldType<GeneralDiagnostics.RadioFault[]>;
        previous: FieldType<GeneralDiagnostics.RadioFault[]>;
    }>, any>>;
}

Access the behavior's events.

Type declaration

Type declaration

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    dataModelTest: 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> & {
    networkInterfaces: TypeFromFields<{
        hardwareAddress: FieldType<Uint8Array>;
        iPv4Addresses: FieldType<Uint8Array[]>;
        iPv6Addresses: FieldType<Uint8Array[]>;
        isOperational: FieldType<boolean>;
        name: FieldType<string>;
        offPremiseServicesReachableIPv4: FieldType<null | boolean>;
        offPremiseServicesReachableIPv6: FieldType<null | boolean>;
        type: FieldType<GeneralDiagnostics.InterfaceType>;
    }>[];
    rebootCount: number;
    testEventTriggersEnabled: boolean;
    upTime: number | bigint;
} & {
    activeHardwareFaults?: GeneralDiagnostics.HardwareFault[];
    activeNetworkFaults?: GeneralDiagnostics.NetworkFault[];
    activeRadioFaults?: GeneralDiagnostics.RadioFault[];
    bootReason?: GeneralDiagnostics.BootReason;
    totalOperationalHours?: number;
} & {} & {}

Access the behavior's state.

Type declaration

  • ReadonlynetworkInterfaces: TypeFromFields<{
        hardwareAddress: FieldType<Uint8Array>;
        iPv4Addresses: FieldType<Uint8Array[]>;
        iPv6Addresses: FieldType<Uint8Array[]>;
        isOperational: FieldType<boolean>;
        name: FieldType<string>;
        offPremiseServicesReachableIPv4: FieldType<null | boolean>;
        offPremiseServicesReachableIPv6: FieldType<null | boolean>;
        type: FieldType<GeneralDiagnostics.InterfaceType>;
    }>[]

    The NetworkInterfaces attribute shall be a list of NetworkInterface structs. Each logical network interface on the Node shall be represented by a single entry within the NetworkInterfaces attribute.

    MatterSpecification.v13.Core § 11.12.6.1

  • ReadonlyrebootCount: number

    The RebootCount attribute shall indicate a best-effort count of the number of times the Node has rebooted. The RebootCount attribute SHOULD be incremented each time the Node reboots. The RebootCount attribute shall NOT be incremented when a Node wakes from a low-power or sleep state. The RebootCount attribute shall only be reset to 0 upon a factory reset of the Node.

    MatterSpecification.v13.Core § 11.12.6.2

  • ReadonlytestEventTriggersEnabled: boolean

    The TestEventTriggersEnabled attribute shall indicate whether the Node has any TestEventTrigger configured. When this attribute is true, the Node has been configured with one or more test event triggers by virtue of the internally programmed EnableKey value (see Section 11.12.7.1, “TestEventTrigger Command”) being set to a non-zero value. This attribute can be used by Administrators to detect if a device was inadvertently commissioned with test event trigger mode enabled, and take appropriate action (e.g. warn the user and/or offer to remove all fabrics on the Node).

    MatterSpecification.v13.Core § 11.12.6.9

  • ReadonlyupTime: number | bigint

    The UpTime attribute shall indicate a best-effort assessment of the length of time, in seconds, since the Node’s last reboot. This attribute SHOULD be incremented to account for the periods of time that a Node is in a low-power or sleep state. This attribute shall only be reset upon a device reboot. This attribute shall be based on the same System Time source as those used to fulfill any usage of the system-us and system-ms data types within the server.

    MatterSpecification.v13.Core § 11.12.6.3

Type declaration

  • Optional ReadonlyactiveHardwareFaults?: GeneralDiagnostics.HardwareFault[]

    The ActiveHardwareFaults attribute shall indicate the set of faults currently detected by the Node. When the Node detects a fault has been raised, the appropriate HardwareFaultEnum value shall be added to this list. This list shall NOT contain more than one instance of a specific HardwareFaultEnum value. When the Node detects that all conditions contributing to a fault has been cleared, the corresponding HardwareFaultEnum value shall be removed from this list. An empty list shall indicate there are currently no active faults. The order of this list SHOULD have no significance. Clients interested in monitoring changes in active faults may subscribe to this attribute, or they may subscribe to HardwareFaultChange.

    MatterSpecification.v13.Core § 11.12.6.6

  • Optional ReadonlyactiveNetworkFaults?: GeneralDiagnostics.NetworkFault[]

    The ActiveNetworkFaults attribute shall indicate the set of faults currently detected by the Node. When the Node detects a fault has been raised, the appropriate NetworkFaultEnum value shall be added to this list. This list shall NOT contain more than one instance of a specific NetworkFaultEnum value. When the Node detects that all conditions contributing to a fault has been cleared, the corresponding NetworkFaultEnum value shall be removed from this list. An empty list shall indicate there are currently no active faults. The order of this list SHOULD have no significance. Clients interested in monitoring changes in active faults may subscribe to this attribute, or they may subscribe to NetworkFaultChange.

    MatterSpecification.v13.Core § 11.12.6.8

  • Optional ReadonlyactiveRadioFaults?: GeneralDiagnostics.RadioFault[]

    The ActiveRadioFaults attribute shall indicate the set of faults currently detected by the Node. When the Node detects a fault has been raised, the appropriate RadioFaultEnum value shall be added to this list. This list shall NOT contain more than one instance of a specific RadioFaultEnum value. When the Node detects that all conditions contributing to a fault has been cleared, the corresponding RadioFaultEnum value shall be removed from this list. An empty list shall indicate there are currently no active faults. The order of this list SHOULD have no significance. Clients interested in monitoring changes in active faults may subscribe to this attribute, or they may subscribe to RadioFaultChange.

    MatterSpecification.v13.Core § 11.12.6.7

  • Optional ReadonlybootReason?: GeneralDiagnostics.BootReason

    The BootReason attribute shall indicate the reason for the Node’s most recent boot.

    MatterSpecification.v13.Core § 11.12.6.5

  • Optional ReadonlytotalOperationalHours?: number

    The TotalOperationalHours attribute shall indicate a best-effort attempt at tracking the length of time, in hours, that the Node has been operational. The TotalOperationalHours attribute SHOULD be incremented to account for the periods of time that a Node is in a low-power or sleep state. The TotalOperationalHours attribute shall only be reset upon a factory reset of the Node.

    MatterSpecification.v13.Core § 11.12.6.4

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