How to use the node-opcua-basic-types.decodeUInt32 function in node-opcua-basic-types

To help you get started, we’ve selected a few node-opcua-basic-types 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-variant / source / variant.ts View on Github external
function _decodeVariantArrayDebug(stream: BinaryStream, decode: any, tracer: any, dataType: DataType) {

  let cursorBefore = stream.length;
  const length = decodeUInt32(stream);

  let i;
  let element;
  tracer.trace("start_array", "Variant", length, cursorBefore, stream.length);

  const n1 = Math.min(10, length);

  // display a maximum of 10 elements
  for (i = 0; i < n1; i++) {
    tracer.trace("start_element", "", i);
    cursorBefore = stream.length;
    element = decode(stream);
    // arr.push(element);
    tracer.trace("member", "Variant", element, cursorBefore, stream.length, DataType[dataType]);
    tracer.trace("end_element", "", i);
  }
github node-opcua / node-opcua / packages / node-opcua-variant / schemas / Variant_schema.js View on Github external
function _decodeVariantArrayDebug(stream, decode, tracer, dataType) {

    let cursor_before = stream.length;
    const length = ec.decodeUInt32(stream);
    let i, element;
    tracer.trace("start_array", "Variant", length, cursor_before, stream.length);

    const n1 = Math.min(10, length);
    // display a maximum of 10 elements
    for (i = 0; i < n1; i++) {
        tracer.trace("start_element", "", i);
        cursor_before = stream.length;
        element = decode(stream);
        // arr.push(element);
        tracer.trace("member", "Variant", element, cursor_before, stream.length, dataType.key);
        tracer.trace("end_element", "", i);
    }
    // keep reading
    if (length >= n1) {
        for (i = n1; i < length; i++) {
github node-opcua / node-opcua / packages / node-opcua-packet-analyzer / source / packet_analyzer / packet_analyzer.ts View on Github external
function display_encodeable(value: any, buffer1: Buffer, start: number, end: number) {
        const bufferExtract = buffer1.slice(start, end);
        const stream = new BinaryStream(bufferExtract);
        const nodeId = decodeNodeId(stream);
        const encodingMask = decodeByte(stream); // 1 bin 2: xml
        const length = decodeUInt32(stream);

        display(chalk.green("     ExpandedNodId =") + " " + nodeId);
        display(chalk.green("     encoding mask =") + " " + encodingMask);
        display(chalk.green("            length =") + " " + length);
        analyzePacket(bufferExtract.slice(stream.length), value.encodingDefaultBinary, padding + 2, start + stream.length);

    }
github node-opcua / node-opcua / packages / node-opcua-transport / source / AcknowledgeMessage.ts View on Github external
public decode(stream: BinaryStream): void {
        // call base class implementation first
        super.decode(stream);
        this.protocolVersion = decodeUInt32(stream);
        this.receiveBufferSize = decodeUInt32(stream);
        this.sendBufferSize = decodeUInt32(stream);
        this.maxMessageSize = decodeUInt32(stream);
        this.maxChunkCount = decodeUInt32(stream);
    }
}
github node-opcua / node-opcua / packages / node-opcua-variant / schemas / Variant_schema.js View on Github external
function decodeGeneralArray(dataType, stream) {

    const length = ec.decodeUInt32(stream);

    if (length === 0xFFFFFFFF) {
        return null;
    }

    const decode = get_decoder(dataType);

    const arr = [];
    for (let i = 0; i < length; i++) {
        arr.push(decode(stream));
    }
    return arr;
}
github node-opcua / node-opcua / packages / node-opcua-transport / source / HelloMessage.ts View on Github external
public decode(stream: BinaryStream): void {
        super.decode(stream);
        this.protocolVersion = decodeUInt32(stream);
        this.receiveBufferSize = decodeUInt32(stream);
        this.sendBufferSize = decodeUInt32(stream);
        this.maxMessageSize = decodeUInt32(stream);
        this.maxChunkCount = decodeUInt32(stream);
        this.endpointUrl = decodeUAString(stream);
    }
}
github node-opcua / node-opcua / packages / node-opcua-chunkmanager / source / SequenceHeader.ts View on Github external
public decode(stream: BinaryStream): void {
        super.decode(stream);
        this.sequenceNumber = decodeUInt32(stream);
        this.requestId = decodeUInt32(stream);
    }
}
github node-opcua / node-opcua / packages / node-opcua-variant / schemas / Variant_schema.js View on Github external
function decodeTypedArray(ArrayType, stream) {

    const length = ec.decodeUInt32(stream);
    if (length === 0xFFFFFFFF) {
        return null;
    }

    const byteLength = length * ArrayType.BYTES_PER_ELEMENT;
    const arr = stream.readArrayBuffer(byteLength);
    const value = new ArrayType(arr.buffer);
    assert(value.length === length);
    return value;
}
github node-opcua / node-opcua / packages / node-opcua-chunkmanager / source / SequenceHeader.ts View on Github external
public decode(stream: BinaryStream): void {
        super.decode(stream);
        this.sequenceNumber = decodeUInt32(stream);
        this.requestId = decodeUInt32(stream);
    }
}