Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);