Skip to content

Commit 76d46d4

Browse files
author
Akos Kitta
committed
fix: close monitor if port changed during upload
the client will automatically request a new monitor with the new port
1 parent 97f1801 commit 76d46d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arduino-ide-extension/src/node/monitor-manager.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
PluggableMonitorSettings,
99
Port,
1010
PortIdentifier,
11+
portIdentifierEquals,
1112
} from '../common/protocol';
1213
import { CoreClientAware } from './core-client-provider';
1314
import { MonitorService } from './monitor-service';
@@ -214,7 +215,11 @@ export class MonitorManager extends CoreClientAware {
214215

215216
const monitor = this.monitorServices.get(beforeMonitorID);
216217
if (monitor) {
217-
await monitor.start();
218+
if (portIdentifierEquals(beforePort, afterPort)) {
219+
await monitor.start();
220+
} else {
221+
await monitor.stop();
222+
}
218223
}
219224

220225
// this monitorID will only be present in "disposedForUpload"

0 commit comments

Comments
 (0)