How to use the node-opcua-factory.constructObject function in node-opcua-factory

To help you get started, we’ve selected a few node-opcua-factory 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-packet-analyzer / source / packet_analyzer / packet_analyzer.ts View on Github external
export function analyseExtensionObject(buffer: Buffer, padding: number, offset: number, customOptions?: AnalyzePacketOptions) {

    const stream = new BinaryStream(buffer);
    let id;
    let objMessage;
    try {

        id = decodeExpandedNodeId(stream);
        objMessage = constructObject(id);
    } catch (err) {
        console.log(id);
        console.log(err);
        console.log("Cannot read decodeExpandedNodeId  on stream " + stream.buffer.toString("hex"));
    }
    _internalAnalyzePacket(buffer, stream, objMessage, padding, customOptions, offset);
}
github node-opcua / node-opcua / packages / node-opcua-extension-object / source / extension_object.ts View on Github external
function constructEmptyExtensionObject(expandedNodeId: NodeId): ExtensionObject {
    return constructObject(expandedNodeId as ExpandedNodeId);
}
github node-opcua / node-opcua / packages / node-opcua-server / src / opcua_server.js View on Github external
Factory.prototype.constructObject = function (id) {
    return factories.constructObject(id);
};
github node-opcua / node-opcua / packages / node-opcua-server / source / factory.ts View on Github external
public constructObject(id: ExpandedNodeId): ExtensionObject {
        const obj = constructObject(id);
        if (!(obj instanceof ExtensionObject)) {
            throw new Error("Internal Error constructObject");
        }
        return obj as ExtensionObject;
    }
}