(port)
| 39 | } |
| 40 | |
| 41 | export 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 | |
| 64 | export const GetPortName = (port) => { |
| 65 | // On linux the friendly name does not exist, so we need to make a name |
no test coverage detected