How to use iotagent-node-lib - 10 common examples

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
iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
            ], function (error) {
                if (error) {
                    winston.error(error);
                    return callback(error);
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
            ], function (error) {
                if (error) {
                    winston.error(error);
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
function start (newConfig, callback) {
    config.setConfig(newConfig);
    iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
            ], function (error) {
                if (error) {
                    winston.error(error);
                    return callback(error);
                } else {
                    return callback();
                }
            });
        }
    });
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
            ], function (error) {
                if (error) {
                    winston.error(error);
                    return callback(error);
                } else {
                    return callback();
                }
            });
        }
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
            ], function (error) {
                if (error) {
                    winston.error(error);
                    return callback(error);
                } else {
                    return callback();
                }
            });
        }
    });
}
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
                loadDevices
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / lib / iotagent-lora.js View on Github external
iotAgentLib.activate(config.getConfig().iota, function (error) {
        if (error) {
            return callback(error);
        } else {
            winston.info('iotagent-node-lib activated');
            iotAgentLib.setProvisioningHandler(registerDevice);
            iotAgentLib.setConfigurationHandler(registerConfiguration);

            // Enables all the plugins
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.addEvents.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.multiEntity.update);
            iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.timestampProcess.update);

            iotAgentLib.addDeviceProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.deviceProvision);
            iotAgentLib.addConfigurationProvisionMiddleware(iotAgentLib.dataPlugins.bidirectionalData.groupProvision);
            iotAgentLib.addNotificationMiddleware(iotAgentLib.dataPlugins.bidirectionalData.notification);

            async.waterfall([
                loadTypesFromConfig,
                loadServices,
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / test / unit / multientityPlugin.js View on Github external
after(function(done) {
        async.series(
            [
                iotAgentLib.clearAll,
                iotagentLora.stop,
                async.apply(utils.deleteEntityCB, iotAgentConfig.iota.contextBroker, service, subservice, 'LORA-N-003'),
                async.apply(utils.deleteEntityCB, iotAgentConfig.iota.contextBroker, service, subservice, 'Mote001')
            ],
            done
        );
    });
github Atos-Research-and-Innovation / IoTagent-LoRaWAN / test / unit / groupProvisioning.js View on Github external
after(function (done) {
        async.series([
            iotAgentLib.clearAll,
            iotagentLora.stop,
            async.apply(utils.deleteEntityCB, iotAgentConfig.iota.contextBroker, service, subservice, 'lora_unprovisioned_device:LoraDeviceGroup'),
            async.apply(utils.deleteEntityCB, iotAgentConfig.iota.contextBroker, service, subservice, 'lora_unprovisioned_device2:LoraDeviceGroup')
        ], done);
    });