Skip to content

Commit

Permalink
bug in serial port
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar-Raygoza committed Jan 2, 2020
1 parent bf29e67 commit 259a5af
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/renderer/modules/ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ export const getters = {
});

store.dispatch(setSerialPorts(all_ports));
},
__SET_PORT() {
console.log(this.port);
var sp = new SerialPort(this.port, { baudRate: 9600 });
sp.pipe(parser);
console.log(sp);
return sp;
}
};

function __SET_PORT() {
var sp = new SerialPort(this.port, { baudRate: 9600 });
sp.pipe(parser);
console.log(sp);
return sp;
}
export const actions = {
CONNECT_TO_SERIALPORT(port, url, urlPort, connection) {
store.dispatch(getDataPort("..."));
const sp = __SET_PORT.call(port);
const state = { port, url, urlPort, connection };
const sp = getters.__SET_PORT.call(state);
if (connection) {
//sp.close();
}
Expand Down

0 comments on commit 259a5af

Please sign in to comment.