Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var DeviceClient = require('azure-iot-device').Client
- var DeviceProtocol = require('azure-iot-device-amqp').AmqpWs
- [...]
- var connectionString = "HostName=.....";
- [...]
- var client = DeviceClient.fromConnectionString(connectionString, DeviceProtocol);
- [...]
- client.on('message', onMessage);
- function onMessage(msg) {
- console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);
- messageController.exec(JSON.parse(msg.data.toString()));
- client.complete(msg, printResultFor('completed'));
- }
Add Comment
Please, Sign In to add comment