This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/Dashboard/app/renderer/store/reducers/comConnectionReducer.js

15 lines
322 B
JavaScript
Raw Normal View History

2020-08-01 15:42:10 +02:00
import SerialPort from 'serialport';
const Readline = require('@serialport/parser-readline');
const port = new SerialPort('COM3', {
baudRate: 9600,
});
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
const initialState = { port, parser };
2020-08-02 11:00:50 +02:00
export default (state = initialState) => {
2020-08-01 15:42:10 +02:00
return state;
};