How to use the node-opcua-basic-types.encodeUInt16 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-model / source / qualified_name.ts View on Github external
public encode(stream: OutputBinaryStream): void {
        // call base class implementation first
        super.encode(stream);
        encodeUInt16(this.namespaceIndex, stream);
        encodeUAString(this.name, stream);
    }
github node-opcua / node-opcua / packages / node-opcua-data-value / schemas / DataValue_schema.js View on Github external
}

        // write statusCode
        if (check_flag(encoding_mask, DataValueEncodingByte.StatusCode)) {
            //ec.encodeUInt32(dataValue.statusCode.value,stream);
            ec.encodeStatusCode(dataValue.statusCode,stream);
        }
        // write sourceTimestamp
        if (check_flag(encoding_mask, DataValueEncodingByte.SourceTimestamp)) {
            ec.encodeHighAccuracyDateTime(dataValue.sourceTimestamp,dataValue.sourcePicoseconds,stream);
        }
        // write sourcePicoseconds
        if (check_flag(encoding_mask, DataValueEncodingByte.SourcePicoseconds)) {
            assert(dataValue.sourcePicoseconds  != null );
            const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) /10);
            ec.encodeUInt16(sourcePicoseconds,stream);
        }
        // write serverTimestamp
        if (check_flag(encoding_mask, DataValueEncodingByte.ServerTimestamp)) {
            ec.encodeHighAccuracyDateTime(dataValue.serverTimestamp,dataValue.serverPicoseconds,stream);
        }
        // write serverPicoseconds
        if (check_flag(encoding_mask, DataValueEncodingByte.ServerPicoseconds)) {
            assert(dataValue.serverPicoseconds  != null);
            const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000 ) / 10) ; // we encode 10-pios
            ec.encodeUInt16(serverPicoseconds,stream);
        }
    },
    decode_debug: function(dataValue,stream,options) {
github node-opcua / node-opcua / packages / node-opcua-data-value / source / datavalue.ts View on Github external
}
    dataValue.value.encode(stream);
  }
  // write statusCode
  if (encodingMask & DataValueEncodingByte.StatusCode) {
    encodeStatusCode(dataValue.statusCode, stream);
  }
  // write sourceTimestamp
  if ((encodingMask & DataValueEncodingByte.SourceTimestamp) && (dataValue.sourceTimestamp !== null)) {
    encodeHighAccuracyDateTime(dataValue.sourceTimestamp, dataValue.sourcePicoseconds, stream);
  }
  // write sourcePicoseconds
  if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
    assert(dataValue.sourcePicoseconds !== null);
    const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) / 10);
    encodeUInt16(sourcePicoseconds, stream);
  }
  // write serverTimestamp
  if ((encodingMask & DataValueEncodingByte.ServerTimestamp) && dataValue.serverTimestamp !== null) {
    encodeHighAccuracyDateTime(dataValue.serverTimestamp, dataValue.serverPicoseconds, stream);
  }
  // write serverPicoseconds
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    assert(dataValue.serverPicoseconds !== null);
    const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000) / 10); // we encode 10-pios
    encodeUInt16(serverPicoseconds, stream);
  }
}
github node-opcua / node-opcua / packages / node-opcua-data-value / schemas / DataValue_schema.js View on Github external
}
        // write sourcePicoseconds
        if (check_flag(encoding_mask, DataValueEncodingByte.SourcePicoseconds)) {
            assert(dataValue.sourcePicoseconds  != null );
            const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) /10);
            ec.encodeUInt16(sourcePicoseconds,stream);
        }
        // write serverTimestamp
        if (check_flag(encoding_mask, DataValueEncodingByte.ServerTimestamp)) {
            ec.encodeHighAccuracyDateTime(dataValue.serverTimestamp,dataValue.serverPicoseconds,stream);
        }
        // write serverPicoseconds
        if (check_flag(encoding_mask, DataValueEncodingByte.ServerPicoseconds)) {
            assert(dataValue.serverPicoseconds  != null);
            const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000 ) / 10) ; // we encode 10-pios
            ec.encodeUInt16(serverPicoseconds,stream);
        }
    },
    decode_debug: function(dataValue,stream,options) {
github node-opcua / node-opcua / packages / node-opcua-data-value / source / datavalue.ts View on Github external
}
  // write sourcePicoseconds
  if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
    assert(dataValue.sourcePicoseconds !== null);
    const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) / 10);
    encodeUInt16(sourcePicoseconds, stream);
  }
  // write serverTimestamp
  if ((encodingMask & DataValueEncodingByte.ServerTimestamp) && dataValue.serverTimestamp !== null) {
    encodeHighAccuracyDateTime(dataValue.serverTimestamp, dataValue.serverPicoseconds, stream);
  }
  // write serverPicoseconds
  if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
    assert(dataValue.serverPicoseconds !== null);
    const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000) / 10); // we encode 10-pios
    encodeUInt16(serverPicoseconds, stream);
  }
}