Skip to content

Commit db9a6a1

Browse files
committed
fix serial port open
1 parent c38fdc8 commit db9a6a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/main/serial.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ const serial = {
3030
window.webContents.send('serialData', buffer);
3131
}
3232
});
33-
resolve({error: false, id: this._id++});
33+
34+
this._serialport.on('open', () => {
35+
resolve({error: false, id: this._id++});
36+
});
37+
3438
} catch (err) {
3539
resolve ({error: true, errorMsg: err});
3640
}

0 commit comments

Comments
 (0)