How to use the node-opcua.NodeClassMask function in node-opcua

To help you get started, we’ve selected a few node-opcua 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-samples / bin / simple_client.js View on Github external
function _getAllEventTypes(baseNodeId, tree, callback) {

        //xx console.log(" exploring elements,",element.nodeId.toString());
        const browseDesc1 = {
            nodeId: baseNodeId,
            referenceTypeId: opcua.resolveNodeId("HasSubtype"),
            browseDirection: BrowseDirection.Forward,
            includeSubtypes: true,
            nodeClassMask: opcua.NodeClassMask.ObjectType, // Objects
            resultMask: 63
        };
        session.browse(browseDesc1, function (err, browseResult) {
            if (err) {
                console.log(" ERROR = ", err);
            } else {
                // to do continuation points
                browseResult.references.forEach(function (reference) {
                    const subtree = { nodeId: reference.nodeId.toString() };
                    tree[reference.browseName.toString()] = subtree;
                    q.push({ nodeId: reference.nodeId, tree: subtree });
                });

            }

            callback();
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_client.js View on Github external
function _getAllEventTypes(baseNodeId,tree,callback) {

        //xx console.log(" exploring elements,",element.nodeId.toString());
        const browseDesc1 = {
            nodeId: baseNodeId,
            referenceTypeId: opcua.resolveNodeId("HasSubtype"),
            browseDirection: BrowseDirection.Forward,
            includeSubtypes: true,
            nodeClassMask: opcua.NodeClassMask.ObjectType, // Objects
            resultMask: 63
        };
        session.browse(browseDesc1, function(err,browseResult){
            if (err) {
                console.log(" ERROR = ", err);
            } else {
                // to do continuation points
                browseResult.references.forEach(function (reference) {
                    const subtree = {nodeId: reference.nodeId.toString()};
                    tree[reference.browseName.toString()] = subtree;
                    q.push({nodeId: reference.nodeId, tree: subtree});
                });

            }

            callback();