How to use the iotagent-node-lib.register 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
commands: configuration.commands,
        internalAttributes: configuration.internalAttributes
    };

    if (newDevice.internalAttributes instanceof Array) {
        for (var i = 0; i < newDevice.internalAttributes.length; i++) {
            if (newDevice.internalAttributes[i].lorawan) {
                newDevice.internalAttributes[i].lorawan.dev_eui = deviceEUI;
                break;
            }
        }
    } else {
        newDevice.internalAttributes.lorawan.dev_eui = deviceEUI;
    }

    iotAgentLib.register(newDevice, callback);
}