From a1da6a5147ed75b637a8ded6ba63cd3c68c386d6 Mon Sep 17 00:00:00 2001 From: Jonathan Wang Date: Thu, 22 Aug 2019 17:06:20 -0700 Subject: [PATCH 1/2] Update test message for serial monitor --- src/constants.ts | 4 ++++ src/serialPortControl.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 2dff4dabc..52bd0668d 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -204,6 +204,10 @@ export const CONSTANTS = { SERIAL_MONITOR_NAME: localize( "misc.serialMonitorName", "Pacifica Serial Monitor" + ), + SERIAL_MONITOR_TEST_IF_OPEN: localize( + "misc.testIfPortOpen", + "Test if serial port is open" ) }, NAME: localize("name", "Pacifica Simulator"), diff --git a/src/serialPortControl.ts b/src/serialPortControl.ts index b34bf9350..02483afcc 100644 --- a/src/serialPortControl.ts +++ b/src/serialPortControl.ts @@ -73,7 +73,7 @@ export class SerialPortControl { this._currentSerialPort = new SerialPortControl.serialport(this._currentPort, { baudRate: this._currentBaudRate }); this._outputChannel.show(); this._currentSerialPort.on("open", () => { - this._currentSerialPort.write("msft", "Both NL & CR", (err: any) => { + this._currentSerialPort.write(CONSTANTS.MISC.SERIAL_MONITOR_TEST_IF_OPEN, "Both NL & CR", (err: any) => { if (err && !(err.message.indexOf(CONSTANTS.ERROR.COMPORT_UNKNOWN_ERROR) >= 0)) { logToOutputChannel(this._outputChannel, CONSTANTS.ERROR.FAILED_TO_OPEN_SERIAL_PORT(this._currentPort)); reject(err); From 9f21b1f3f53b7b057e6ccc643ae268f104297853 Mon Sep 17 00:00:00 2001 From: Jonathan Wang Date: Fri, 23 Aug 2019 12:49:16 -0700 Subject: [PATCH 2/2] Add additional log statement to output channel --- src/constants.ts | 4 ++++ src/serialPortControl.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/constants.ts b/src/constants.ts index 52bd0668d..1e7176339 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -89,6 +89,10 @@ export const CONSTANTS = { "error.noPythonPath", "We found that you don't have Python 3 installed on your computer, please install the latest version, add it to your PATH and try again." ), + RECONNECT_DEVICE: localize( + "error.reconnectDevice", + "Please disconnect your Circuit Playground Express and try again." + ), STDERR: (data: string) => { return localize("error.stderr", `\n[ERROR] ${data} \n`); }, diff --git a/src/serialPortControl.ts b/src/serialPortControl.ts index 02483afcc..0b3eb3912 100644 --- a/src/serialPortControl.ts +++ b/src/serialPortControl.ts @@ -76,6 +76,7 @@ export class SerialPortControl { this._currentSerialPort.write(CONSTANTS.MISC.SERIAL_MONITOR_TEST_IF_OPEN, "Both NL & CR", (err: any) => { if (err && !(err.message.indexOf(CONSTANTS.ERROR.COMPORT_UNKNOWN_ERROR) >= 0)) { logToOutputChannel(this._outputChannel, CONSTANTS.ERROR.FAILED_TO_OPEN_SERIAL_PORT(this._currentPort)); + logToOutputChannel(this._outputChannel, CONSTANTS.ERROR.RECONNECT_DEVICE); reject(err); } else { logToOutputChannel(this._outputChannel, CONSTANTS.INFO.OPENED_SERIAL_PORT(this._currentPort));