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