How to use the node-opcua-common.ServerStatus function in node-opcua-common

To help you get started, we’ve selected a few node-opcua-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / src / server_engine.js View on Github external
options = options || {};
    options.buildInfo = options.buildInfo || {};

    EventEmitter.apply(this, arguments);
    const engine = this;
    ServerEngine.registry.register(engine);

    engine._sessions = {};
    engine._closedSessions = {};
    engine._orphanPublishEngine = null; // will be constructed on demand

    engine.isAuditing = _.isBoolean(options.isAuditing) ? options.isAuditing : false;

    options.buildInfo.buildDate = options.buildInfo.buildDate || new Date();
    // ---------------------------------------------------- ServerStatus
    engine.serverStatus = new ServerStatus({
        startTime: new Date(),
        currentTime: new Date(),
        state: ServerState.NoConfiguration,
        buildInfo: options.buildInfo,
        secondsTillShutdown: 0,
        shutdownReason: {text: ""}
    });


    // --------------------------------------------------- ServerCapabilities
    options.serverCapabilities = options.serverCapabilities || {};
    options.serverCapabilities.serverProfileArray = options.serverCapabilities.serverProfileArray || [
        "Standard UA Server Profile",
        "Embedded UA Server Profile",
        "Micro Embedded Device Server Profile",
        "Nano Embedded Device Server Profile"