Added more debug to investigate webbluetooth device attachment issues
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Nathan Kellenicki 2019-12-11 13:28:39 +09:00
parent e624efd067
commit 59179652dd
4 changed files with 5 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "5.0.1",
"version": "5.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "5.0.1",
"version": "5.0.2",
"description": "A Javascript module to interface with LEGO Powered Up components.",
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
"main": "dist/node/index-node.js",

View File

@ -146,8 +146,10 @@ export class PoweredUP extends EventEmitter {
resolve(Consts.HubType.CONTROL_PLUS_HUB);
break;
}
debug("Hub type determined");
});
} else {
debug("Stashed in mailbox (LPF2_ALL)", message);
device.addToCharacteristicMailbox(Consts.BLECharacteristic.LPF2_ALL, message);
}
}

View File

@ -107,6 +107,7 @@ export class WebBLEDevice extends EventEmitter implements IBLEDevice {
};
this._characteristics[uuid].addEventListener("characteristicvaluechanged", this._listeners[uuid]);
for (const data of this._mailbox) {
debug("Replayed from mailbox (LPF2_ALL)", data);
callback(data);
}
this._mailbox = [];