A Node.js SDK for connecting devices to Microsoft Azure IoT services
OTHER License
This branch of the Azure IoT SDK for Node.js contains code to use the Mqtt protocol to act as a Microsoft Azure IoT Edge module and talk to a Microsoft Azure IoT Edge hub instance.
This code is not currently published on NPM. In order to use these modules, you need to use the versions in this branch. Instructions for working with this code outside of the NPM repository can be found here
reject_unauthorized
A module can receive inputs by registering for the inputMessage event.
client.on('inputMessage', function(inputName, msg) {
// inputName is a string that contains the name of the input, and msg is a Message object
});
A module can send a Message to an output by using the sendOutputEvent function
client.sendOutputEvent(outputName, msg);
// outputName is a string that contains the name of the output and msg is a Message object.
A module can act as a twin using the existing twin API. The only difference between a device twin and a module twin is the connection string used to connect.
A module can also support methods using the existing method API.
Some sample code can be found in the device/samples directory: