Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created May 2, 2014 23:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bwhite/11488412 to your computer and use it in GitHub Desktop.
Save bwhite/11488412 to your computer and use it in GitHub Desktop.
[wearscript] IBeacon Basics
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<script>
function server() {
WS.beaconOn();
WS.subscribe('ibeacon', function (channel, uuid, rssid, major, minor, proximity) {
WS.log(channel + ' ' + uuid + ' ' + rssid + ' ' + major + ' ' + minor + ' ' + proximity);
WS.say(proximity)
})
}
function main() {
if (WS.scriptVersion(1)) return;
WS.serverConnect('{{WSUrl}}', server);
}
window.onload = main;
</script>
</body>
</html>
{"name":"Example"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment