Fixed bug with retrieving hardware versions
This commit is contained in:
parent
7255c83ae9
commit
0fbd27d41f
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-poweredup",
|
"name": "node-poweredup",
|
||||||
"version": "4.2.0",
|
"version": "4.2.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-poweredup",
|
"name": "node-poweredup",
|
||||||
"version": "4.2.0",
|
"version": "4.2.1",
|
||||||
"description": "A Javascript module to interface with LEGO Powered Up components.",
|
"description": "A Javascript module to interface with LEGO Powered Up components.",
|
||||||
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
|
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
|
||||||
"main": "dist/node/index-node.js",
|
"main": "dist/node/index-node.js",
|
||||||
|
@ -43,10 +43,11 @@ export class LPF2Hub extends Hub {
|
|||||||
if (this.type === Consts.HubType.DUPLO_TRAIN_HUB) {
|
if (this.type === Consts.HubType.DUPLO_TRAIN_HUB) {
|
||||||
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x41, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01]));
|
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x41, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01]));
|
||||||
}
|
}
|
||||||
this.emit("connect");
|
|
||||||
resolve();
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x01, 0x03, 0x05])); // Request firmware version again
|
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x01, 0x03, 0x05])); // Request firmware version again
|
||||||
|
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x01, 0x04, 0x05])); // Request firmware version again
|
||||||
|
this.emit("connect");
|
||||||
|
resolve();
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -267,7 +268,7 @@ export class LPF2Hub extends Hub {
|
|||||||
|
|
||||||
let port = this._getPortForPortNumber(data[3]);
|
let port = this._getPortForPortNumber(data[3]);
|
||||||
|
|
||||||
if (data[4] === 0x01) {
|
if (data[4] === 0x01 && process.env["PORT_DEBUG_INFO"]) {
|
||||||
this._sendPortInformationRequest(data[3]);
|
this._sendPortInformationRequest(data[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user