jsHint passing versions of BBB, scanBLE and wemo nodes.

Also fixe and in vs out issue on wemo... no way it could have been working previously..
This commit is contained in:
Dave C-J
2014-06-30 23:41:38 +01:00
parent c14364d752
commit 999874f2b5
3 changed files with 469 additions and 465 deletions

View File

@@ -37,29 +37,30 @@ function BleScan(n) {
this.ble_name = n.ble_name;
this.ble_uuid = n.ble_uuid;
this.on("input", function(msg){
noble.startScanning();
});
noble.on('scanStart', function(msg) {
var msg = {};
this.on("input", function(msg){
noble.startScanning();
});
noble.on('scanStart', function(msg) {
msg = {};
msg.topic = node.topic;
msg.payload = "Scanning initiated..." //debugging
//console.log('scanning initiated...');
node.send(msg);
});
noble.on('discover', function(peripheral) {
//console.log('scanning initiated...');
node.send(msg);
});
noble.on('discover', function(peripheral) {
var msg = {};
msg.topic = node.topic;
msg.topic = node.topic;
msg.payload = "not found";
//check for the device name and the UUID (first one from the UUID list)
if(peripheral.advertisement.localName==node.ble_name && peripheral.advertisement.serviceUuids[0]==node.ble_uuid) {
msg.payload=peripheral.advertisement.localName;
noble.stopScanning(); }
noble.stopScanning();
}
node.send(msg);
});
});
this.on("close", function() {
try { noble.stopScanning(); }