Skip to content

Commit

Permalink
web interface for doc tracker added
Browse files Browse the repository at this point in the history
  • Loading branch information
bikash committed Mar 17, 2016
1 parent 64ce4dd commit de89863
Show file tree
Hide file tree
Showing 9 changed files with 662 additions and 196 deletions.
17 changes: 6 additions & 11 deletions demo/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@
});
smoothieChart.streamTo(document.getElementById("mycanvas"), 250);
}
function publish(address, message, sensor) {
function publish(address, message) {
var headers = {sensor: "hr"};
//alert(message)
eb.publish(address, message, headers);
}
function subscribe(address) {
Expand Down Expand Up @@ -169,24 +168,20 @@
});
}
$(document).ready(function() {
//var wsUri = "ws://localhost:5555/ws";
var host = "localhost:5555"
//var eb = new WebSocket(host);
//var host = "ws://localhost:9090/ws";

//console.log("socket status: " + socket.readyState);
hrElement = $("#hr"); //document.getElementById("hr");
heartElement = $("#heart");
setupSmootie();
//eb = new EventBus(socket);
eb = new vertx.EventBus("http://localhost:5555");
//eb = new EventBus('http://apsrt1451:5555/eventbus');
eb = new EventBus('http://localhost:5555/eventbus');
eb.onopen = function () {
subscribeToHeartrate();
subscribeToActivity();
};
$("#sendButton").click(function() {
var msg = $("textarea#sendMessage").val();
publish(host, JSON.parse(msg),"iot.in.hr");
publish("iot.in.hr", JSON.parse(msg));
//subscribeToHeartrate();
subscribe("iot.in.hr")
});
});
</script>
Expand Down
Loading

0 comments on commit de89863

Please sign in to comment.