How to use node-opcua-schemas - 3 common examples

To help you get started, we’ve selected a few node-opcua-schemas 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-client-dynamic-extension-object / source / client_dynamic_extension_object.ts View on Github external
const binaryEncodingNodeIds = results2.map((br: BrowseResult) => {
        const defaultBin = br.references!.filter((r: ReferenceDescription) => r.browseName.toString() === "Default Binary");

        /* istanbul ignore next */
        if (defaultBin.length < 1) {
            return ExpandedNodeId;
        }
        return ExpandedNodeId.fromNodeId(defaultBin[0].nodeId, namespaces[defaultBin[0].nodeId.namespace]);
    });

    const tuples = _.zip(references, binaryEncodingNodeIds);

    for (const [ref, defaultBinary] of tuples) {
        const name = ref.browseName!.name!.toString();
        const constructor = getOrCreateConstructor(name, typeDictionary, defaultBinary);

        /* istanbul ignore next */
        if (doDebug) {
            // let's verify that constructor is operational
            try {
                const testObject = new constructor();
                debugLog(testObject.toString());
            } catch (err) {
                debugLog(err.message);
            }
        }
    }
}
github node-opcua / node-opcua / packages / node-opcua-client-dynamic-extension-object / source / extra_data_type_manager.ts View on Github external
public getExtensionObjectConstructorFromDataType(
        dataTypeNodeId: NodeId
    ): AnyConstructorFunc {
        const typeDictionary = this.getTypeDictionaryForNamespace(dataTypeNodeId.namespace);
        // find schema corresponding to dataTypeNodeId in typeDictionary
        const schema = findSchemaForDataType(typeDictionary, dataTypeNodeId);
        const Constructor = createDynamicObjectConstructor(schema, typeDictionary);
        return Constructor;
    }
github node-opcua / node-opcua / packages / node-opcua-client-dynamic-extension-object / source / extra_data_type_manager.ts View on Github external
public getExtensionObjectConstructorFromBinaryEncoding(
        binaryEncodingNodeId: NodeId
    ): AnyConstructorFunc {
        const typeDictionary = this.getTypeDictionaryForNamespace(binaryEncodingNodeId.namespace);
        // find schema corresponding to binaryEncodingNodeId in typeDictionary
        const schema = findSchemaForBinaryEncoding(typeDictionary, binaryEncodingNodeId);
        const Constructor = createDynamicObjectConstructor(schema, typeDictionary);
        return Constructor;
    }

node-opcua-schemas

pure nodejs OPCUA SDK - module schemas

MIT
Latest version published 1 month ago

Package Health Score

83 / 100
Full package analysis