How to use the node-opcua-service-subscription.EventNotificationList function in node-opcua-service-subscription

To help you get started, we’ve selected a few node-opcua-service-subscription 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_subscription.ts View on Github external
dataChangedNotificationData.length + eventNotificationListData.length);

      notifications = [];

      // add dataChangeNotification
      if (dataChangedNotificationData.length) {
        const dataChangeNotification = new DataChangeNotification({
          diagnosticInfos: [],
          monitoredItems: dataChangedNotificationData
        });
        notifications.push(dataChangeNotification);
      }

      // add dataChangeNotification
      if (eventNotificationListData.length) {
        const eventNotificationList = new EventNotificationList({
          events: eventNotificationListData
        });

        notifications.push(eventNotificationList);
      }

      assert(notifications.length === 1 || notifications.length === 2);
      notificationsMessage.push(notifications);
    }

    assert(notificationsMessage instanceof Array);
    return notificationsMessage;
  }