// Create a message and send it to the IoT Hub every second. -----> this just polls Iothub's C2D device queue.
setInterval(function () {
var data = JSON.stringify({ text : 'foo' });
var message = new Message(data);
console.log('Sending message: ' + message.getData());
client.send(targetDevice, message, printResultFor('send'));
}, 2000);
}
});
// Create a message and send it to the IoT Hub every second. -----> this just polls Iothub's C2D device queue. setInterval(function () { var data = JSON.stringify({ text : 'foo' }); var message = new Message(data); console.log('Sending message: ' + message.getData()); client.send(targetDevice, message, printResultFor('send')); }, 2000); } });