diff --git a/Web/areyousatisfied.html b/Web/areyousatisfied.html index e69de29..a934ed5 100644 --- a/Web/areyousatisfied.html +++ b/Web/areyousatisfied.html @@ -0,0 +1,27 @@ + + + +
+ + + + + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/Web/index.html b/Web/index.html index e69de29..ca032dd 100644 --- a/Web/index.html +++ b/Web/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + +
+

Michael's Demonstrations

+
+ + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/Web/js/areyousatisfied.js b/Web/js/areyousatisfied.js index e69de29..2916eed 100644 --- a/Web/js/areyousatisfied.js +++ b/Web/js/areyousatisfied.js @@ -0,0 +1,35 @@ +//var msgpack = require("msgpack-lite"); + +// Assuming paho mqtt library is included. +host = "172.16.13.128"; +client = new Paho.MQTT.Client(host, port=1884, "2343"); + +client.onMessageArrived = onMessage; +client.onConnectionLost = onConnectionLost; +client.connect({onSuccess: onConnect}); + +function onConnect(){ + alert("Client Connected"); + client.subscribe("Demo"); + var buffer = msgpack.encode({"message": "Hello"}); + message = new Paho.MQTT.Message(buffer); + message.destinationName = "Demo"; + + // // Can use publish or send here. + client.publish(message); +} + +function onConnectionLost(responseObject){ + if(responseObject.errorCode !== 0){ + console.log("onConnectionLost:" + responseObject.errorMessage); + } +} + +function onMessage(message){ + messageb = message.payloadBytes; + + if(message.payloadBytes = 1){ + // Sent checking ready command. + + } +} \ No newline at end of file