Created
June 27, 2014 01:37
-
-
Save johnnyman727/78e90eadaebabc06d5fa to your computer and use it in GitHub Desktop.
Use Tessel as an iBeacon device
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
var tessel = require('tessel'); | |
var blePort = tessel.port['A']; | |
var bleLib = require('ble-ble113a'); | |
var data = new Buffer('0201061aff4c000215e2c56db5dffb48d2b060d0f5a71096e000000000c6','hex'); | |
var ble = bleLib.use(blePort, function(err) { | |
if (err) return console.log("Error connecting to slave", err); | |
ble.setAdvertisingData(data, function (e2){ | |
if (e2) console.log("Error set adv", e2); | |
// start adveristing to any listening masters | |
ble.startAdvertising(function(e3) { | |
if (e3) return console.log("Err start adv", e3); | |
console.log('waiting for discovery...'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment