From f23e5ad679a1461adf29a3dab7b707a0d124eb3c Mon Sep 17 00:00:00 2001 From: Nathan Kellenicki Date: Mon, 18 Mar 2019 11:16:54 -0700 Subject: [PATCH] Seperated BLEDevice out into NobleDevice and WebBLEDevice usingi nterfaces --- docs/BoostMoveHub.html | 2 +- docs/DuploTrainBase.html | 2 +- docs/Hub.html | 2 +- docs/LPF2Hub.html | 2 +- docs/PUPHub.html | 2 +- docs/PUPRemote.html | 2 +- docs/PoweredUP.html | 2 +- docs/WeDo2SmartHub.html | 2 +- docs/boostmovehub.js.html | 2 +- docs/classes.list.html | 2 +- docs/consts.js.html | 2 +- docs/duplotrainbase.js.html | 2 +- docs/global.html | 2 +- docs/hub.js.html | 2 +- docs/index.html | 2 +- docs/lpf2hub.js.html | 2 +- docs/poweredup-node.js.html | 6 +- docs/puphub.js.html | 2 +- docs/pupremote.js.html | 2 +- docs/quicksearch.html | 2 +- docs/wedo2smarthub.js.html | 2 +- src/bledevice.ts | 237 ------------------------------------ src/boostmovehub.ts | 4 +- src/duplotrainbase.ts | 4 +- src/hub.ts | 14 +-- src/interfaces.ts | 23 ++++ src/nobledevice.ts | 150 +++++++++++++++++++++++ src/poweredup-browser.ts | 9 +- src/poweredup-node.ts | 4 +- src/puphub.ts | 4 +- src/pupremote.ts | 4 +- src/webbledevice.ts | 149 +++++++++++++++++++++++ src/wedo2smarthub.ts | 4 +- 33 files changed, 364 insertions(+), 288 deletions(-) delete mode 100644 src/bledevice.ts create mode 100644 src/interfaces.ts create mode 100644 src/nobledevice.ts create mode 100644 src/webbledevice.ts diff --git a/docs/BoostMoveHub.html b/docs/BoostMoveHub.html index 921e057..49fd8c8 100644 --- a/docs/BoostMoveHub.html +++ b/docs/BoostMoveHub.html @@ -5585,7 +5585,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/DuploTrainBase.html b/docs/DuploTrainBase.html index 835617e..e1c9657 100644 --- a/docs/DuploTrainBase.html +++ b/docs/DuploTrainBase.html @@ -4188,7 +4188,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/Hub.html b/docs/Hub.html index 8bf8e93..4442788 100644 --- a/docs/Hub.html +++ b/docs/Hub.html @@ -2467,7 +2467,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/LPF2Hub.html b/docs/LPF2Hub.html index a3c0ff1..1bf9dac 100644 --- a/docs/LPF2Hub.html +++ b/docs/LPF2Hub.html @@ -4444,7 +4444,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/PUPHub.html b/docs/PUPHub.html index 8d2da95..a055c2a 100644 --- a/docs/PUPHub.html +++ b/docs/PUPHub.html @@ -5157,7 +5157,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/PUPRemote.html b/docs/PUPRemote.html index 364dc0e..ec5551f 100644 --- a/docs/PUPRemote.html +++ b/docs/PUPRemote.html @@ -3409,7 +3409,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/PoweredUP.html b/docs/PoweredUP.html index 2f14ab3..d2d1ce3 100644 --- a/docs/PoweredUP.html +++ b/docs/PoweredUP.html @@ -1018,7 +1018,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/WeDo2SmartHub.html b/docs/WeDo2SmartHub.html index 968d9cb..cd2ba69 100644 --- a/docs/WeDo2SmartHub.html +++ b/docs/WeDo2SmartHub.html @@ -5158,7 +5158,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/boostmovehub.js.html b/docs/boostmovehub.js.html index eb89251..0cc78ff 100644 --- a/docs/boostmovehub.js.html +++ b/docs/boostmovehub.js.html @@ -351,7 +351,7 @@ exports.BoostMoveHub = BoostMoveHub; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/classes.list.html b/docs/classes.list.html index b7460bc..14f4f46 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -6681,7 +6681,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/consts.js.html b/docs/consts.js.html index 6b6ca33..7630ee5 100644 --- a/docs/consts.js.html +++ b/docs/consts.js.html @@ -282,7 +282,7 @@ var BLECharacteristic; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/duplotrainbase.js.html b/docs/duplotrainbase.js.html index 4838532..abc2847 100644 --- a/docs/duplotrainbase.js.html +++ b/docs/duplotrainbase.js.html @@ -300,7 +300,7 @@ exports.DuploTrainBase = DuploTrainBase; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/global.html b/docs/global.html index 8a9f2ed..ae65fe9 100644 --- a/docs/global.html +++ b/docs/global.html @@ -3272,7 +3272,7 @@ Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/hub.js.html b/docs/hub.js.html index f9fe130..3d1be18 100644 --- a/docs/hub.js.html +++ b/docs/hub.js.html @@ -448,7 +448,7 @@ exports.Hub = Hub; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index 61d13c7..43b292a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -314,7 +314,7 @@ poweredUP.scan(); // Start scanning for Hubs

More examples are av Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/lpf2hub.js.html b/docs/lpf2hub.js.html index 2b520ff..a911a94 100644 --- a/docs/lpf2hub.js.html +++ b/docs/lpf2hub.js.html @@ -503,7 +503,7 @@ exports.LPF2Hub = LPF2Hub; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/poweredup-node.js.html b/docs/poweredup-node.js.html index 36d4fa6..63914e5 100644 --- a/docs/poweredup-node.js.html +++ b/docs/poweredup-node.js.html @@ -93,9 +93,9 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -const bledevice_1 = require("./bledevice"); const boostmovehub_1 = require("./boostmovehub"); const duplotrainbase_1 = require("./duplotrainbase"); +const nobledevice_1 = require("./nobledevice"); const puphub_1 = require("./puphub"); const pupremote_1 = require("./pupremote"); const wedo2smarthub_1 = require("./wedo2smarthub"); @@ -193,7 +193,7 @@ class PoweredUP extends events_1.EventEmitter { return Object.keys(this._connectedHubs).map((uuid) => this._connectedHubs[uuid]).filter((hub) => hub.name === name); } async _discoveryEventHandler(peripheral) { - const device = new bledevice_1.BLEDevice(peripheral); + const device = new nobledevice_1.NobleDevice(peripheral); let hub; if (await wedo2smarthub_1.WeDo2SmartHub.IsWeDo2SmartHub(peripheral)) { hub = new wedo2smarthub_1.WeDo2SmartHub(device, this.autoSubscribe); @@ -286,7 +286,7 @@ exports.PoweredUP = PoweredUP; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/puphub.js.html b/docs/puphub.js.html index c3cbbcb..d607e32 100644 --- a/docs/puphub.js.html +++ b/docs/puphub.js.html @@ -308,7 +308,7 @@ exports.PUPHub = PUPHub; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/pupremote.js.html b/docs/pupremote.js.html index 45428d1..54b6563 100644 --- a/docs/pupremote.js.html +++ b/docs/pupremote.js.html @@ -238,7 +238,7 @@ exports.PUPRemote = PUPRemote; Documentation generated by JSDoc 3.5.5 - on Thu Feb 7th 2019 + on Mon Mar 18th 2019 using the DocStrap template. diff --git a/docs/quicksearch.html b/docs/quicksearch.html index 3a9e2c5..6d29a66 100644 --- a/docs/quicksearch.html +++ b/docs/quicksearch.html @@ -7,7 +7,7 @@