diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-08 12:49:53 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-08 12:49:53 +0200 |
commit | 615a043031f37fe5bc55fdf9cbc2e83a5e305908 (patch) | |
tree | 128a22f4d34934ec7c7d75a78ffea7c16c7c32fb /src/beer-duke.js | |
parent | bcf3120d437da01fda78397a345bf805b008eb7a (diff) | |
download | beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.gz beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.bz2 beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.tar.xz beer-duke-615a043031f37fe5bc55fdf9cbc2e83a5e305908.zip |
wip
Diffstat (limited to 'src/beer-duke.js')
-rw-r--r-- | src/beer-duke.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/beer-duke.js b/src/beer-duke.js deleted file mode 100644 index 8178836..0000000 --- a/src/beer-duke.js +++ /dev/null @@ -1,31 +0,0 @@ -import angular from 'angular'; - -function run() { - function onConnect() { - // Once a connection has been made, make a subscription and send a message. - console.log("onConnect"); - client.subscribe("/World"); - let message = new Paho.MQTT.Message("Hello"); - message.destinationName = "/World"; - client.send(message); - } - - function onConnectionLost(responseObject) { - if (responseObject.errorCode !== 0) - console.log("onConnectionLost:" + responseObject.errorMessage); - } - - function onMessageArrived(message) { - console.log("onMessageArrived:" + message.payloadString); - client.disconnect(); - } - - //let client = new Paho.MQTT.Client("trygvis.io", 9001, "/", "clientId"); - let client = new Paho.MQTT.Client("wss://trygvis.io:9001/", "clientId"); - client.onConnectionLost = onConnectionLost; - client.onMessageArrived = onMessageArrived; - client.connect({onSuccess: onConnect}); -} - -angular.module('BeerDuke', []) - .run(run); |