fix device type read regression

This commit is contained in:
Michal Szafranski 2019-11-03 17:40:02 +01:00
parent 522a8c2e23
commit 8346988604

View File

@ -268,7 +268,7 @@ export class LPF2Hub extends Hub {
private _parsePortMessage (data: Buffer) { private _parsePortMessage (data: Buffer) {
let port = this._getPortForPortNumber(data[3]); let port = this._getPortForPortNumber(data[3]);
const type = data.readUInt16LE(5); const type = data[4] ? data.readUInt16LE(5) : 0;
if (data[4] === 0x01 && this.sendPortInformationRequests) { if (data[4] === 0x01 && this.sendPortInformationRequests) {
modeInfoDebug(`Port ${this._toHex(data[3])}, type ${this._toHex(type, 4)} (${Consts.DeviceTypeNames[data[5]] || "unknown"})`); modeInfoDebug(`Port ${this._toHex(data[3])}, type ${this._toHex(type, 4)} (${Consts.DeviceTypeNames[data[5]] || "unknown"})`);