Last active
August 29, 2015 14:01
-
-
Save shokai/0354aaf8a72873f4412b to your computer and use it in GitHub Desktop.
iBeacon on Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
*#* | |
.DS_Store | |
node_modules | |
*.log | |
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ビーコン発信側 | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ビーコン受信側 | |
Bleacon = require 'bleacon' | |
Bleacon.startScanning() | |
Bleacon.on 'discover', (beacon) -> | |
console.log beacon | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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