mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
added some comments
This commit is contained in:
parent
7d41db377f
commit
7ceeae38b1
@ -3,7 +3,7 @@
|
|||||||
* Scans for a specific Bluetooth 4 (BLE) Device (by Name and UUID)
|
* Scans for a specific Bluetooth 4 (BLE) Device (by Name and UUID)
|
||||||
* Returns the Name the of Device when found and stops scanning
|
* Returns the Name the of Device when found and stops scanning
|
||||||
* Requires Noble: https://github.com/sandeepmistry/noble
|
* Requires Noble: https://github.com/sandeepmistry/noble
|
||||||
* Copyright 2013 Charalampos Doukas
|
* Copyright 2013 Charalampos Doukas - @BuildingIoT
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -19,6 +19,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
//might need to modify accordingly
|
||||||
var RED = require("../../red/red");
|
var RED = require("../../red/red");
|
||||||
|
|
||||||
//import noble
|
//import noble
|
||||||
@ -54,6 +55,7 @@ function Scan(n) {
|
|||||||
msg.topic = node.topic;
|
msg.topic = node.topic;
|
||||||
msg.payload = "not found";
|
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) {
|
if(peripheral.advertisement.localName==node.ble_name && peripheral.advertisement.serviceUuids[0]==node.ble_uuid) {
|
||||||
msg.payload=peripheral.advertisement.localName;
|
msg.payload=peripheral.advertisement.localName;
|
||||||
noble.stopScanning(); }
|
noble.stopScanning(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user