How to use node-opcua-client-dynamic-extension-object - 5 common examples

To help you get started, we’ve selected a few node-opcua-client-dynamic-extension-object 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-address-space / source / helpers / call_helpers.ts View on Github external
ensureDatatypeExtractedWithCallback(addressSpace, (err2: Error|null, extraDataTypeManager: ExtraDataTypeManager) => {

        l_extraDataTypeManager = extraDataTypeManager;

        // resolve opaque data structure from inputArguments
        for (const variant of inputArguments) {
            resolveDynamicExtensionObject(variant, l_extraDataTypeManager);
        }

        methodObj.execute(inputArguments, context,
            (err: Error | null, callMethodResponse?: CallMethodResultOptions) => {

                /* istanbul ignore next */
                if (err) {
                    return callback(err);
                }
                if (!callMethodResponse) {
                    return callback(new Error("internal Error"));
                }

                callMethodResponse.inputArgumentResults = response.inputArgumentResults || [];
                assert(callMethodResponse.statusCode);
github node-opcua / node-opcua / packages / node-opcua-address-space / source / helpers / call_helpers.ts View on Github external
}

                callMethodResponse.inputArgumentResults = response.inputArgumentResults || [];
                assert(callMethodResponse.statusCode);

                if (callMethodResponse.statusCode === StatusCodes.Good) {
                    assert(_.isArray(callMethodResponse.outputArguments));
                }

                assert(_.isArray(callMethodResponse.inputArgumentResults));
                assert(callMethodResponse.inputArgumentResults!.length === methodInputArguments.length);

                if (callMethodResponse.outputArguments) {
                    const outputArguments = callMethodResponse.outputArguments || [];
                    for (const variant of outputArguments) {
                        resolveDynamicExtensionObject(variant as Variant, l_extraDataTypeManager);
                    }    
                }
        
                return callback(null, callMethodResponse);
            });
    });
github node-opcua / node-opcua / packages / node-opcua-server / source / server_engine.ts View on Github external
function performWrite(
      writeValue: WriteValue,
      inner_callback: (err: Error | null, statusCode?: StatusCode) => void
    ) {
      assert(writeValue instanceof WriteValue);
      const ignored_promise = resolveDynamicExtensionObject(writeValue.value.value, l_extraDataTypeManager);
      engine.writeSingleNode(context, writeValue, inner_callback);
    }
github node-opcua / node-opcua / packages / node-opcua-address-space / source / loader / load_nodeset2.ts View on Github external
export async function ensureDatatypeExtracted(addressSpace: any): Promise {
    const addressSpacePriv: any = addressSpace as any;
    if (!addressSpacePriv.$$extraDataTypeManager) {
        const session = new PseudoSession(addressSpace);
        const extraDataTypeManager = new ExtraDataTypeManager();

        const namespaceArray =
            addressSpace.getNamespaceArray().map((n: Namespace) => n.namespaceUri);

        debugLog("Namespace Array = ", namespaceArray);

        extraDataTypeManager.setNamespaceArray(namespaceArray);
        await extractNamespaceDataType(session, extraDataTypeManager);
        addressSpacePriv.$$extraDataTypeManager = extraDataTypeManager;
    }
    return addressSpacePriv.$$extraDataTypeManager;
}
export const ensureDatatypeExtractedWithCallback = callbackify(ensureDatatypeExtracted) as any;
github node-opcua / node-opcua / packages / node-opcua-address-space / source / loader / load_nodeset2.ts View on Github external
export async function ensureDatatypeExtracted(addressSpace: any): Promise {
    const addressSpacePriv: any = addressSpace as any;
    if (!addressSpacePriv.$$extraDataTypeManager) {
        const session = new PseudoSession(addressSpace);
        const extraDataTypeManager = new ExtraDataTypeManager();

        const namespaceArray =
            addressSpace.getNamespaceArray().map((n: Namespace) => n.namespaceUri);

        debugLog("Namespace Array = ", namespaceArray);

        extraDataTypeManager.setNamespaceArray(namespaceArray);
        await extractNamespaceDataType(session, extraDataTypeManager);
        addressSpacePriv.$$extraDataTypeManager = extraDataTypeManager;
    }
    return addressSpacePriv.$$extraDataTypeManager;
}
export const ensureDatatypeExtractedWithCallback = callbackify(ensureDatatypeExtracted) as any;

node-opcua-client-dynamic-extension-object

pure nodejs OPCUA SDK - module client-dynamic-extension-object

MIT
Latest version published 7 days ago

Package Health Score

86 / 100
Full package analysis