April 2017
Intermediate to advanced
280 pages
6h 18m
English
The following lines declare the onConnectSuccess and connect functions within the APP.HomeAutomation.Manager object. The code file for the sample is included in the mqtt_essentials_gaston_hillar_05 folder, in the home_automation.js file:
onConnectSuccess: function(invocationContext) { onConnectSuccess: function(invocationContext) { // Update the status text document.getElementById("status").textContent = "Connected with the MQTT Server"; // Now, subscribe to home/results/leds/1, home/results/leds/2 and // home/results/leds/3 var client = invocationContext.invocationContext.client; for (var i = 1; i < 4; i++) { client.subscribe("home/results/leds/" + i); } }, connect: function() { this.client ...Read now
Unlock full access