Skip to content
Snippets Groups Projects
Commit b41dbd6b authored by echicken's avatar echicken :chicken:
Browse files

Hold outbound queue until device ready.

parent 88659ac2
No related branches found
No related tags found
No related merge requests found
...@@ -343,6 +343,10 @@ export default abstract class Device extends js.global.EventEmitter { ...@@ -343,6 +343,10 @@ export default abstract class Device extends js.global.EventEmitter {
// Hot eats, cool treats // Hot eats, cool treats
private dequeue(): void { private dequeue(): void {
if (!this.ready) {
this.on('ready', this.dequeue.bind(this));
return;
}
const buf = this.queue.shift(); const buf = this.queue.shift();
if (buf === undefined) return; if (buf === undefined) return;
this.sendToDevice(buf); this.sendToDevice(buf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment