MCPcopy Create free account
hub / github.com/curiores/SerialAnalyzer / StartSerial

Function StartSerial

src/Utils/SerialData.js:41–62  ·  view source on GitHub ↗
(port)

Source from the content-addressed store, hash-verified

39}
40
41export function StartSerial(port) {
42
43 // Clear the data when the serial first starts
44 SerialDataObject.rawData = [];
45 SerialDataObject.data = [];
46 SerialDataObject.dataIndex = [];
47 SerialDataObject.pauseFlag = false;
48 SerialDataObject.Iter = 0;
49 SerialDataObject.sampleHistory = [];
50 SerialDataObject.timeHistory = [];
51
52 // Always try to close the serial object before starting one
53 if (SerialDataObject.serialObj !== null) {
54 // Close the serial port
55 SerialDataObject.serialObj.close((err) => {
56 console.log("Stop serial port? Error:" + err)
57 serialSetup(port);
58 });
59 } else {
60 serialSetup(port);
61 }
62}
63
64export const GetPortName = (port) => {
65 // On linux the friendly name does not exist, so we need to make a name

Callers 4

GlobalSettingsPaneFunction · 0.90
formChangeFunction · 0.90
handleCloseFunction · 0.90
playCallbackFunction · 0.90

Calls 1

serialSetupFunction · 0.85

Tested by

no test coverage detected