How to use the node-opcua-nodeid.ExpandedNodeId function in node-opcua-nodeid

To help you get started, we’ve selected a few node-opcua-nodeid 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-schemas / source / dynamic_extension_object.ts View on Github external
if (schema.baseType !== "ExtensionObject") {
        BaseClass = getOrCreateConstructor(schema.baseType, typeDictionary);
        if (!BaseClass) {
            throw new Error("Cannot find base class : " + schema.baseType);
        }
        if ((BaseClass as any).possibleFields) {
            possibleFields = (BaseClass as any).possibleFields.concat(possibleFields);
        }

        schema._baseSchema = BaseClass.schema;
    }

    // tslint:disable-next-line:max-classes-per-file
    class EXTENSION extends BaseClass {
        public static encodingDefaultXml = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
        public static encodingDefaultBinary = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
        public static possibleFields = possibleFields;
        public static schema = schema;

        constructor(options?: any, schema2?: StructuredTypeSchema, typeDictionary2?: TypeDictionary) {
            super(options, schema2 ? schema2 : schema, typeDictionary2 ? typeDictionary2 : typeDictionary);
        }

        public toString(): string {
            return super.toString();
        }

    }

    // to do : may be remove DataType suffix here ?
    Object.defineProperty(EXTENSION, "name", { value: schema.name });
github node-opcua / node-opcua / packages / node-opcua-schemas / source / dynamic_extension_object.ts View on Github external
let BaseClass: AnyConstructorFunc = DynamicExtensionObject as AnyConstructorFunc;
    if (schema.baseType !== "ExtensionObject") {
        BaseClass = getOrCreateConstructor(schema.baseType, typeDictionary);
        if (!BaseClass) {
            throw new Error("Cannot find base class : " + schema.baseType);
        }
        if ((BaseClass as any).possibleFields) {
            possibleFields = (BaseClass as any).possibleFields.concat(possibleFields);
        }

        schema._baseSchema = BaseClass.schema;
    }

    // tslint:disable-next-line:max-classes-per-file
    class EXTENSION extends BaseClass {
        public static encodingDefaultXml = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
        public static encodingDefaultBinary = new ExpandedNodeId(NodeIdType.NUMERIC, 0, 0);
        public static possibleFields = possibleFields;
        public static schema = schema;

        constructor(options?: any, schema2?: StructuredTypeSchema, typeDictionary2?: TypeDictionary) {
            super(options, schema2 ? schema2 : schema, typeDictionary2 ? typeDictionary2 : typeDictionary);
        }

        public toString(): string {
            return super.toString();
        }

    }

    // to do : may be remove DataType suffix here ?
    Object.defineProperty(EXTENSION, "name", { value: schema.name });
github node-opcua / node-opcua / packages / node-opcua-basic-types / source / nodeid.ts View on Github external
export function decodeExpandedNodeId(stream: BinaryStream): ExpandedNodeId {
    const encodingByte = stream.readUInt8();
    const expandedNodeId = _decodeNodeId(encodingByte, stream) as ExpandedNodeId;
    expandedNodeId.namespaceUri = null;
    expandedNodeId.serverIndex = 0;

    if (encodingByte & EnumNodeIdEncoding.NamespaceUriFlag) {
        expandedNodeId.namespaceUri = decodeString(stream);
    }
    if (encodingByte & EnumNodeIdEncoding.ServerIndexFlag) {
        expandedNodeId.serverIndex = decodeUInt32(stream);
    }
    const e: ExpandedNodeId = expandedNodeId;
    return new ExpandedNodeId(e.identifierType, e.value, e.namespace, e.namespaceUri, e.serverIndex);
}