How to use the node-opcua-common.ServerStatusDataType 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 / source / server_engine.ts View on Github external
super();

    options = options || { applicationUri: "" } as ServerEngineOptions;
    options.buildInfo = options.buildInfo || {};

    ServerEngine.registry.register(this);

    this._sessions = {};
    this._closedSessions = {};
    this._orphanPublishEngine = undefined; // will be constructed on demand

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

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

    // --------------------------------------------------- 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"
    ];