How to use the node-opcua-data-model.makeAccessLevel function in node-opcua-data-model

To help you get started, we’ve selected a few node-opcua-data-model 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-address-space / test_to_fix / test_address_space_construct_extension_object.js View on Github external
serverStatus.readValue().value.value.buildInfo.productName.should.eql("productName1");
        serverStatus.buildInfo.productName.readValue().value.value.should.eql("productName1");

        serverStatus.buildInfo.productName.setValueFromSource({dataType: DataType.String, value: "productName2"});
        serverStatus.readValue().value.value.buildInfo.productName.should.eql("productName2");
        serverStatus.buildInfo.productName.readValue().value.value.should.eql("productName2");

        var async = require("async");
        var StatusCodes = require("node-opcua-status-code").StatusCodes;
        var write_service = require("node-opcua-service-write");
        var WriteValue = write_service.WriteValue;
        var makeAccessLevel = require("node-opcua-data-model").makeAccessLevel;

        // now use WriteValue instead
        // make sure value is writable
        var rw = makeAccessLevel("CurrentRead | CurrentWrite");
        serverStatus.buildInfo.productName.accessLevel = rw;
        serverStatus.buildInfo.productName.userAccessLevel = rw;

        serverStatus.buildInfo.accessLevel = rw;
        serverStatus.buildInfo.userAccessLevel = rw;

        serverStatus.accessLevel = rw;
        serverStatus.userAccessLevel = rw;

        async.series([
            function (callback) {

                var writeValue = new WriteValue({
                    attributeId: 13, // value
                    value: {
                        statusCode: StatusCodes.Good,
github node-opcua / node-opcua / packages / node-opcua-address-space / src / loader / load_nodeset2.js View on Github external
function convertAccessLevel(accessLevel) {

    accessLevel = parseInt(accessLevel || 1); // CurrentRead if not specified

    return makeAccessLevel(accessLevel);

}
github node-opcua / node-opcua / packages / node-opcua-address-space / src / ua_variable.js View on Github external
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
    userAccessLevel = utils.isNullOrUndefined(userAccessLevel) ? "CurrentRead | CurrentWrite" : userAccessLevel;
    userAccessLevel = makeAccessLevel(userAccessLevel);
    accessLevel = utils.isNullOrUndefined(accessLevel) ? "CurrentRead | CurrentWrite" : accessLevel;
    accessLevel = makeAccessLevel(accessLevel);
    return makeAccessLevel(accessLevel.value & userAccessLevel.value);
}
github node-opcua / node-opcua / packages / node-opcua-address-space / src / ua_variable.js View on Github external
function adjust_accessLevel(accessLevel) {
    accessLevel = utils.isNullOrUndefined(accessLevel) ? "CurrentRead | CurrentWrite" : accessLevel;
    accessLevel = makeAccessLevel(accessLevel);
    assert(_.isFinite(accessLevel.value));
    return accessLevel;
}
github node-opcua / node-opcua / packages / node-opcua-address-space / src / ua_variable.js View on Github external
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
    userAccessLevel = utils.isNullOrUndefined(userAccessLevel) ? "CurrentRead | CurrentWrite" : userAccessLevel;
    userAccessLevel = makeAccessLevel(userAccessLevel);
    accessLevel = utils.isNullOrUndefined(accessLevel) ? "CurrentRead | CurrentWrite" : accessLevel;
    accessLevel = makeAccessLevel(accessLevel);
    return makeAccessLevel(accessLevel.value & userAccessLevel.value);
}
github node-opcua / node-opcua / packages / node-opcua-address-space / src / ua_variable.js View on Github external
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
    userAccessLevel = utils.isNullOrUndefined(userAccessLevel) ? "CurrentRead | CurrentWrite" : userAccessLevel;
    userAccessLevel = makeAccessLevel(userAccessLevel);
    accessLevel = utils.isNullOrUndefined(accessLevel) ? "CurrentRead | CurrentWrite" : accessLevel;
    accessLevel = makeAccessLevel(accessLevel);
    return makeAccessLevel(accessLevel.value & userAccessLevel.value);
}