Skip to content

Instantly share code, notes, and snippets.

@shokai
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shokai/0354aaf8a72873f4412b to your computer and use it in GitHub Desktop.
Save shokai/0354aaf8a72873f4412b to your computer and use it in GitHub Desktop.
iBeacon on Node.js
*~
*#*
.DS_Store
node_modules
*.log
tmp
## ビーコン発信側
Bleacon = require 'bleacon'
uuid = process.argv[2] || "805D6740-F575-492A-8668-45E553EB9DF2"
major = 1
minor = 1
console.log uuid
Bleacon.startAdvertising uuid, major, minor, -50
## ビーコン受信側
Bleacon = require 'bleacon'
Bleacon.startScanning()
Bleacon.on 'discover', (beacon) ->
console.log beacon
{
"name": "bleacon-study",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"bleacon": "^0.2.0",
"coffee-script": "^1.7.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment