How to use the node-opcua-basic-types.encodeString 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 / localized_text.ts View on Github external
public encode(stream: OutputBinaryStream) {

        // tslint:disable:no-bitwise
        const encodingMask = getLocalizeText_EncodingByte(this);

        encodeByte(encodingMask, stream);
        if ((encodingMask & 0x01) === 0x01) {
            encodeString(this.locale, stream);
        }

        if ((encodingMask & 0x02) === 0x02) {
            encodeString(this.text, stream);
        }
    }
github node-opcua / node-opcua / packages / node-opcua-data-model / source / diagnostic_info.ts View on Github external
}
    // write namespace uri
    if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
        encodeInt32(diagnosticInfo.namespaceURI, stream);
    }
    // write locale
    if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
        encodeInt32(diagnosticInfo.locale, stream);
    }
    // write localized text
    if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
        encodeInt32(diagnosticInfo.localizedText, stream);
    }
    // write additional info
    if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
        encodeString(diagnosticInfo.additionalInfo, stream);
    }
    // write inner status code
    if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
        encodeStatusCode(diagnosticInfo.innerStatusCode, stream);
    }
    // write  innerDiagnosticInfo
    if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
        assert(diagnosticInfo.innerDiagnosticInfo !== null, "missing innerDiagnosticInfo");
        if (diagnosticInfo.innerDiagnosticInfo) {
            encode_DiagnosticInfo(diagnosticInfo.innerDiagnosticInfo, stream);
        }
    }
}
github node-opcua / node-opcua / packages / node-opcua-data-model / source / localized_text.ts View on Github external
public encode(stream: OutputBinaryStream) {

        // tslint:disable:no-bitwise
        const encodingMask = getLocalizeText_EncodingByte(this);

        encodeByte(encodingMask, stream);
        if ((encodingMask & 0x01) === 0x01) {
            encodeString(this.locale, stream);
        }

        if ((encodingMask & 0x02) === 0x02) {
            encodeString(this.text, stream);
        }
    }
github node-opcua / node-opcua / packages / node-opcua-transport / source / TCPErrorMessage.ts View on Github external
public encode(stream: OutputBinaryStream): void {
        // call base class implementation first
        super.encode(stream);
        encodeStatusCode(this.statusCode, stream);
        encodeString(this.reason, stream);
    }
github node-opcua / node-opcua / packages / node-opcua-data-model / schemas / LocalizedText_schema.js View on Github external
encode: function (localizedText, stream) {
        const encoding_mask = getLocalizeText_EncodingByte(localizedText);
        ec.encodeByte(encoding_mask, stream);
        if ((encoding_mask & 0x01) === 0x01) {
            ec.encodeString(localizedText.locale, stream);
        }
        if ((encoding_mask & 0x02) === 0x02) {
            ec.encodeString(localizedText.text, stream);
        }
    },
    decode_debug: function (self, stream , options) {
github node-opcua / node-opcua / packages / node-opcua-numeric-range / source / numeric_range.ts View on Github external
public encode(stream: OutputBinaryStream) {
    encodeString(this.toEncodeableString(), stream);
  }
github node-opcua / node-opcua / packages / node-opcua-numeric-range / source / numeric_range.ts View on Github external
encode: (value: NumericRange | null, stream: OutputBinaryStream) => {
    assert(value === null || value instanceof NumericRange);
    const strValue = (value === null) ? null : value.toEncodeableString();
    encodeString(strValue, stream);
  },
github node-opcua / node-opcua / packages / node-opcua-service-secure-channel / source / AsymmetricAlgorithmSecurityHeader.ts View on Github external
public encode(stream: OutputBinaryStream): void {
        super.encode(stream);
        encodeString(this.securityPolicyUri, stream);
        encodeByteString(this.senderCertificate, stream);
        encodeByteString(this.receiverCertificateThumbprint, stream);
    }
github node-opcua / node-opcua / packages / node-opcua-data-model / schemas / LocalizedText_schema.js View on Github external
encode: function (localizedText, stream) {
        const encoding_mask = getLocalizeText_EncodingByte(localizedText);
        ec.encodeByte(encoding_mask, stream);
        if ((encoding_mask & 0x01) === 0x01) {
            ec.encodeString(localizedText.locale, stream);
        }
        if ((encoding_mask & 0x02) === 0x02) {
            ec.encodeString(localizedText.text, stream);
        }
    },
    decode_debug: function (self, stream , options) {