interface OtaSoftwareUpdateRequestorBehavior {
    [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> & {
        defaultOtaProviders$Changing: ClusterEvents.AttributeObservable<WritableFabricScopedAttribute<TypeFromFields<{
            endpoint: FieldType<EndpointNumber>;
            fabricIndex: FieldType<FabricIndex>;
            providerNodeId: FieldType<NodeId>;
        }>[], any>>;
        updatePossible$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        updateState$Changing: ClusterEvents.AttributeObservable<Attribute<OtaSoftwareUpdateRequestor.UpdateState, any>>;
        updateStateProgress$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    } & {} & {
        defaultOtaProviders$Changed: ClusterEvents.AttributeObservable<WritableFabricScopedAttribute<TypeFromFields<{
            endpoint: FieldType<EndpointNumber>;
            fabricIndex: FieldType<FabricIndex>;
            providerNodeId: FieldType<NodeId>;
        }>[], any>>;
        updatePossible$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        updateState$Changed: ClusterEvents.AttributeObservable<Attribute<OtaSoftwareUpdateRequestor.UpdateState, any>>;
        updateStateProgress$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    } & {} & {
        downloadError: ClusterEvents.EventObservable<Event<TypeFromFields<{
            bytesDownloaded: FieldType<number | bigint>;
            platformCode: FieldType<null | number | bigint>;
            progressPercent: FieldType<null | number>;
            softwareVersion: FieldType<number>;
        }>, any>>;
        stateTransition: ClusterEvents.EventObservable<Event<TypeFromFields<{
            newState: FieldType<OtaSoftwareUpdateRequestor.UpdateState>;
            previousState: FieldType<OtaSoftwareUpdateRequestor.UpdateState>;
            reason: FieldType<OtaSoftwareUpdateRequestor.ChangeReason>;
            targetSoftwareVersion: FieldType<null | number>;
        }>, any>>;
        versionApplied: ClusterEvents.EventObservable<Event<TypeFromFields<{
            productId: FieldType<number>;
            softwareVersion: FieldType<number>;
        }>, any>>;
    } & {};
    features: TypeFromBitSchema<{}>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        defaultOtaProviders: TypeFromFields<{
            endpoint: FieldType<EndpointNumber>;
            fabricIndex: FieldType<FabricIndex>;
            providerNodeId: FieldType<NodeId>;
        }>[];
        updatePossible: boolean;
        updateState: OtaSoftwareUpdateRequestor.UpdateState;
        updateStateProgress: null | number;
    } & {} & {} & {};
    [asyncDispose](): MaybePromise;
    announceOtaProvider(request: OtaSoftwareUpdateRequestor.AnnounceOtaProviderRequest): 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> & {
    defaultOtaProviders$Changing: ClusterEvents.AttributeObservable<WritableFabricScopedAttribute<TypeFromFields<{
        endpoint: FieldType<EndpointNumber>;
        fabricIndex: FieldType<FabricIndex>;
        providerNodeId: FieldType<NodeId>;
    }>[], any>>;
    updatePossible$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    updateState$Changing: ClusterEvents.AttributeObservable<Attribute<OtaSoftwareUpdateRequestor.UpdateState, any>>;
    updateStateProgress$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
} & {} & {
    defaultOtaProviders$Changed: ClusterEvents.AttributeObservable<WritableFabricScopedAttribute<TypeFromFields<{
        endpoint: FieldType<EndpointNumber>;
        fabricIndex: FieldType<FabricIndex>;
        providerNodeId: FieldType<NodeId>;
    }>[], any>>;
    updatePossible$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    updateState$Changed: ClusterEvents.AttributeObservable<Attribute<OtaSoftwareUpdateRequestor.UpdateState, any>>;
    updateStateProgress$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
} & {} & {
    downloadError: ClusterEvents.EventObservable<Event<TypeFromFields<{
        bytesDownloaded: FieldType<number | bigint>;
        platformCode: FieldType<null | number | bigint>;
        progressPercent: FieldType<null | number>;
        softwareVersion: FieldType<number>;
    }>, any>>;
    stateTransition: ClusterEvents.EventObservable<Event<TypeFromFields<{
        newState: FieldType<OtaSoftwareUpdateRequestor.UpdateState>;
        previousState: FieldType<OtaSoftwareUpdateRequestor.UpdateState>;
        reason: FieldType<OtaSoftwareUpdateRequestor.ChangeReason>;
        targetSoftwareVersion: FieldType<null | number>;
    }>, any>>;
    versionApplied: ClusterEvents.EventObservable<Event<TypeFromFields<{
        productId: FieldType<number>;
        softwareVersion: FieldType<number>;
    }>, any>>;
} & {}

Access the behavior's events.

Type declaration

features: TypeFromBitSchema<{}>

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> & {
    defaultOtaProviders: TypeFromFields<{
        endpoint: FieldType<EndpointNumber>;
        fabricIndex: FieldType<FabricIndex>;
        providerNodeId: FieldType<NodeId>;
    }>[];
    updatePossible: boolean;
    updateState: OtaSoftwareUpdateRequestor.UpdateState;
    updateStateProgress: null | number;
} & {} & {} & {}

Access the behavior's state.

Type declaration

  • ReadonlydefaultOtaProviders: TypeFromFields<{
        endpoint: FieldType<EndpointNumber>;
        fabricIndex: FieldType<FabricIndex>;
        providerNodeId: FieldType<NodeId>;
    }>[]

    This field is a list of ProviderLocation whose entries shall be set by Administrators, either during Commissioning or at a later time, to set the ProviderLocation for the default OTA Provider Node to use for software updates on a given Fabric.

    There shall NOT be more than one entry per Fabric. On a list update that would introduce more than one entry per fabric, the write shall fail with CONSTRAINT_ERROR status code.

    Provider Locations obtained using the AnnounceOTAProvider command shall NOT overwrite values set in the DefaultOTAProviders attribute.

    MatterSpecification.v13.Core § 11.20.7.5.1

  • ReadonlyupdatePossible: boolean

    This field shall be set to True if the OTA Requestor is currently able to be updated. Otherwise, it shall be set to False in case of any condition preventing update being possible, such as insufficient capacity of an internal battery. This field is merely informational for diagnostics purposes and shall NOT affect the responses provided by an OTA Provider to an OTA Requestor.

    MatterSpecification.v13.Core § 11.20.7.5.2

  • ReadonlyupdateState: OtaSoftwareUpdateRequestor.UpdateState

    This field shall reflect the current state of the OTA Requestor with regards to obtaining software updates. See Section 11.20.7.4.2, “UpdateStateEnum Type” for possible values.

    This field SHOULD be updated in a timely manner whenever OTA Requestor internal state updates.

    MatterSpecification.v13.Core § 11.20.7.5.3

  • ReadonlyupdateStateProgress: null | number

    This field shall reflect the percentage value of progress, relative to the current UpdateState, if applicable to the state.

    The value of this field shall be null if a progress indication does not apply to the current state.

    A value of 0 shall indicate that the beginning has occurred. A value of 100 shall indicate completion.

    This field may be updated infrequently. Some care SHOULD be taken by Nodes to avoid over- reporting progress when this attribute is part of a subscription.

    MatterSpecification.v13.Core § 11.20.7.5.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