diff --git a/lpf2hub.ts b/lpf2hub.ts index ece9eb1..a6efb6e 100644 --- a/lpf2hub.ts +++ b/lpf2hub.ts @@ -133,25 +133,16 @@ export class LPF2Hub extends Hub { return resolve(); }; } else { - let data = Buffer.from([0x08, 0x00, 0x81, portObj.value, 0x11, 0x51, 0x00, this._mapSpeed(speed)]); - if (this.type === Consts.Hubs.POWERED_UP_HUB && portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR) { - data = Buffer.from([0x07, 0x00, 0x81, portObj.value, 0x11, 0x02, this._mapSpeed(speed)]); - } + const data = Buffer.from([0x0a, 0x00, 0x81, portObj.value, 0x11, 0x60, 0x00, this._mapSpeed(speed), 0x00, 0x00]); this._writeMessage(Consts.BLECharacteristics.BOOST_ALL, data); setTimeout(() => { - let data = Buffer.from([0x08, 0x00, 0x81, portObj.value, 0x11, 0x51, 0x00, 0x00]); - if (this.type === Consts.Hubs.POWERED_UP_HUB && portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR) { - data = Buffer.from([0x07, 0x00, 0x81, portObj.value, 0x11, 0x02, 0x00]); - } + const data = Buffer.from([0x0a, 0x00, 0x81, portObj.value, 0x11, 0x60, 0x00, 0x00, 0x00, 0x00]); this._writeMessage(Consts.BLECharacteristics.BOOST_ALL, data); return resolve(); }, time); } } else { - let data = Buffer.from([0x08, 0x00, 0x81, portObj.value, 0x11, 0x51, 0x00, this._mapSpeed(speed)]); - if (this.type === Consts.Hubs.POWERED_UP_HUB && portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR) { - data = Buffer.from([0x07, 0x00, 0x81, portObj.value, 0x11, 0x02, this._mapSpeed(speed)]); - } + const data = Buffer.from([0x0a, 0x00, 0x81, portObj.value, 0x11, 0x60, 0x00, this._mapSpeed(speed), 0x00, 0x00]); this._writeMessage(Consts.BLECharacteristics.BOOST_ALL, data); return resolve(); }