How to use the node-opcua-basic-types.decodeUInt16 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-data-value / source / datavalue.ts View on Github external
if (encodingMask & DataValueEncodingByte.StatusCode) {
    dataValue.statusCode = decodeStatusCode(stream);
    tracer.trace("member", "statusCode", dataValue.statusCode, cur, stream.length, "StatusCode");
  }
  // read sourceTimestamp
  cur = stream.length;
  if (encodingMask & DataValueEncodingByte.SourceTimestamp) {
    dataValue.sourceTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.sourcePicoseconds = (dataValue.sourceTimestamp as DateWithPicoseconds).picoseconds;
    tracer.trace("member", "sourceTimestamp", dataValue.sourceTimestamp, cur, stream.length, "DateTime");
  }
  // read sourcePicoseconds
  cur = stream.length;
  dataValue.sourcePicoseconds = 0;
  if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
    const tenPico = decodeUInt16(stream);
    dataValue.sourcePicoseconds += tenPico * 10;
    tracer.trace("member", "sourcePicoseconds", dataValue.sourcePicoseconds, cur, stream.length, "UInt16");
  }
  // read serverTimestamp
  cur = stream.length;
  dataValue.serverPicoseconds = 0;
  if (encodingMask & DataValueEncodingByte.ServerTimestamp) {
    dataValue.serverTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.serverPicoseconds = (dataValue.serverTimestamp as DateWithPicoseconds).picoseconds | 0;
    tracer.trace("member", "serverTimestamp", dataValue.serverTimestamp, cur, stream.length, "DateTime");
  }
  // read serverPicoseconds
  cur = stream.length;
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    const tenPico = decodeUInt16(stream);
    dataValue.serverPicoseconds += tenPico * 10;
github node-opcua / node-opcua / packages / node-opcua-data-model / source / qualified_name.ts View on Github external
public decode(stream: BinaryStream): void {
        // call base class implementation first
        super.decode(stream);
        this.namespaceIndex = decodeUInt16(stream);
        this.name = decodeUAString(stream);
    }
github node-opcua / node-opcua / packages / node-opcua-data-value / source / datavalue.ts View on Github external
const tenPico = decodeUInt16(stream);
    dataValue.sourcePicoseconds += tenPico * 10;
    tracer.trace("member", "sourcePicoseconds", dataValue.sourcePicoseconds, cur, stream.length, "UInt16");
  }
  // read serverTimestamp
  cur = stream.length;
  dataValue.serverPicoseconds = 0;
  if (encodingMask & DataValueEncodingByte.ServerTimestamp) {
    dataValue.serverTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.serverPicoseconds = (dataValue.serverTimestamp as DateWithPicoseconds).picoseconds | 0;
    tracer.trace("member", "serverTimestamp", dataValue.serverTimestamp, cur, stream.length, "DateTime");
  }
  // read serverPicoseconds
  cur = stream.length;
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    const tenPico = decodeUInt16(stream);
    dataValue.serverPicoseconds += tenPico * 10;
    tracer.trace("member", "serverPicoseconds", dataValue.serverPicoseconds, cur, stream.length, "UInt16");
  }
}
github node-opcua / node-opcua / packages / node-opcua-data-value / schemas / DataValue_schema.js View on Github external
const tenPico = ec.decodeUInt16(stream);
            dataValue.sourcePicoseconds  += tenPico * 10;
            tracer.trace("member","sourcePicoseconds", dataValue.sourcePicoseconds,cur,stream.length,"UInt16");
        }
        // read serverTimestamp
        cur = stream.length;
        dataValue.serverPicoseconds = 0;
        if (check_flag(encoding_mask,DataValueEncodingByte.ServerTimestamp)) {
            dataValue.serverTimestamp  = ec.decodeDateTime(stream);
            dataValue.serverPicoseconds = dataValue.serverTimestamp.picoseconds;
            tracer.trace("member","serverTimestamp", dataValue.serverTimestamp,cur,stream.length,"DateTime");
        }
        // read serverPicoseconds
        cur = stream.length;
        if (check_flag(encoding_mask,DataValueEncodingByte.ServerPicoseconds)) {
            const tenPico = ec.decodeUInt16(stream);
            dataValue.serverPicoseconds  += tenPico*10;
            tracer.trace("member","serverPicoseconds", dataValue.serverPicoseconds,cur,stream.length,"UInt16");
        }
    },
github node-opcua / node-opcua / packages / node-opcua-data-value / source / datavalue.ts View on Github external
dataValue.sourceTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.sourcePicoseconds += (dataValue.sourceTimestamp as DateWithPicoseconds).picoseconds | 0;
  }
  // read sourcePicoseconds
  if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
    dataValue.sourcePicoseconds += decodeUInt16(stream) * 10;
  }
  // read serverTimestamp
  dataValue.serverPicoseconds = 0;
  if (encodingMask & DataValueEncodingByte.ServerTimestamp) {
    dataValue.serverTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.serverPicoseconds += (dataValue.serverTimestamp as DateWithPicoseconds).picoseconds | 0;
  }
  // read serverPicoseconds
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    dataValue.serverPicoseconds += decodeUInt16(stream) * 10;
  }
}
github node-opcua / node-opcua / packages / node-opcua-data-value / source / datavalue.ts View on Github external
// read statusCode
  if (encodingMask & DataValueEncodingByte.StatusCode) {
    dataValue.statusCode = decodeStatusCode(stream);
  } else {
    dataValue.statusCode = StatusCodes.Good;
  }

  dataValue.sourcePicoseconds = 0;
  // read sourceTimestamp
  if (encodingMask & DataValueEncodingByte.SourceTimestamp) {
    dataValue.sourceTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.sourcePicoseconds += (dataValue.sourceTimestamp as DateWithPicoseconds).picoseconds | 0;
  }
  // read sourcePicoseconds
  if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
    dataValue.sourcePicoseconds += decodeUInt16(stream) * 10;
  }
  // read serverTimestamp
  dataValue.serverPicoseconds = 0;
  if (encodingMask & DataValueEncodingByte.ServerTimestamp) {
    dataValue.serverTimestamp = decodeHighAccuracyDateTime(stream);
    dataValue.serverPicoseconds += (dataValue.serverTimestamp as DateWithPicoseconds).picoseconds | 0;
  }
  // read serverPicoseconds
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    dataValue.serverPicoseconds += decodeUInt16(stream) * 10;
  }
}
github node-opcua / node-opcua / packages / node-opcua-data-value / schemas / DataValue_schema.js View on Github external
// read statusCode
        if (check_flag(encoding_mask,DataValueEncodingByte.StatusCode)) {
            dataValue.statusCode  = ec.decodeStatusCode(stream);
        } else {
            dataValue.statusCode = StatusCodes.Good;
        }

        dataValue.sourcePicoseconds = 0;
        // read sourceTimestamp
        if (check_flag(encoding_mask,DataValueEncodingByte.SourceTimestamp)) {
            dataValue.sourceTimestamp  = ec.decodeHighAccuracyDateTime(stream);
            dataValue.sourcePicoseconds += dataValue.sourceTimestamp.picoseconds;
        }
        // read sourcePicoseconds
        if (check_flag(encoding_mask,DataValueEncodingByte.SourcePicoseconds)) {
            dataValue.sourcePicoseconds  += ec.decodeUInt16(stream) * 10 ;
        }
        // read serverTimestamp
        dataValue.serverPicoseconds = 0;
        if (check_flag(encoding_mask,DataValueEncodingByte.ServerTimestamp)) {
            dataValue.serverTimestamp  = ec.decodeHighAccuracyDateTime(stream);
            dataValue.serverPicoseconds += dataValue.serverTimestamp.picoseconds;
        }
        // read serverPicoseconds
        if (check_flag(encoding_mask,DataValueEncodingByte.ServerPicoseconds)) {
            dataValue.serverPicoseconds  += ec.decodeUInt16(stream) * 10;
        }
    },