How to use the node-opcua-service-translate-browse-path.TranslateBrowsePathsToNodeIdsRequest function in node-opcua-service-translate-browse-path

To help you get started, we’ve selected a few node-opcua-service-translate-browse-path 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-client / src / client_session.js View on Github external
ClientSession.prototype.translateBrowsePath = function (browsePath, callback) {
    assert(_.isFunction(callback));
    const self = this;


    const isArray = _.isArray(browsePath);
    browsePath = isArray ?  browsePath :[browsePath];

    const request = new translate_service.TranslateBrowsePathsToNodeIdsRequest({
        browsePath: browsePath
    });

    self.performMessageTransaction(request, function (err, response) {

        /* istanbul ignore next */
        if (err) {
            return callback(err, response);
        }
        assert(response instanceof translate_service.TranslateBrowsePathsToNodeIdsResponse);
        callback(null, isArray ? response.results : response.results[0]);

    });

};