How to use the iotagent-node-lib.activate 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 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);