Updated docs
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 2022-01-18 17:52:45 -08:00
parent 32fe39fd8c
commit 57ee61e620
2 changed files with 7 additions and 4 deletions

View File

@ -248,6 +248,8 @@ class Device extends events_1.EventEmitter {
this.send(Buffer.from([0x21, this.portId, 0x00])); this.send(Buffer.from([0x21, this.portId, 0x00]));
} }
finish(message) { finish(message) {
if ((message & 0x10) === 0x10)
return; // "busy/full"
this._busy = (message & 0x01) === 0x01; this._busy = (message & 0x01) === 0x01;
while (this._finishedCallbacks.length > Number(this._busy)) { while (this._finishedCallbacks.length > Number(this._busy)) {
const callback = this._finishedCallbacks.shift(); const callback = this._finishedCallbacks.shift();

View File

@ -410,10 +410,11 @@ class LPF2Hub extends basehub_1.BaseHub {
} }
} }
_parsePortAction(message) { _parsePortAction(message) {
const portId = message[3]; for (let offset = 3; offset < message.length; offset += 2) {
const device = this._getDeviceByPortId(portId); const device = this._getDeviceByPortId(message[offset]);
if (device) { if (device) {
device.finish(message[4]); device.finish(message[offset + 1]);
}
} }
} }
_parseSensorMessage(message) { _parseSensorMessage(message) {