How to use the iotagent-node-lib.listDevices function in iotagent-node-lib

To help you get started, we’ve selected a few iotagent-node-lib 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 Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
function loadDevices (callback) {
    winston.info('Loading devices from registry');
    iotAgentLib.listDevices(undefined, undefined, undefined, undefined, function (err, devices) {
        if (err) {
            winston.error('Error', err);
        }
        if (devices) {
            async.eachSeries(
                devices.devices,
                registerDevice,
                function (err) {
                    if (err) {
                        winston.error('Error loading devices', err);
                        return callback(err);
                    } else {
                        return callback();
                    }
                }
            );