Skip to content

Commit 9c1aba5

Browse files
author
Alberto Iannaccone
committed
send port to web socket clients
1 parent 5519a82 commit 9c1aba5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

+10-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ export class MonitorService extends CoreClientAware implements Disposable {
129129
*/
130130
async start(): Promise<Status> {
131131
if (this.duplex) {
132-
this.updateClientsSettings({ monitorUISettings: { connected: true } });
132+
this.updateClientsSettings({
133+
monitorUISettings: { connected: true, serialPort: this.port.address },
134+
});
133135
return Status.ALREADY_CONNECTED;
134136
}
135137

@@ -140,7 +142,9 @@ export class MonitorService extends CoreClientAware implements Disposable {
140142
}
141143

142144
if (this.uploadInProgress) {
143-
this.updateClientsSettings({ monitorUISettings: { connected: false } });
145+
this.updateClientsSettings({
146+
monitorUISettings: { connected: false, serialPort: this.port.address },
147+
});
144148
return Status.UPLOAD_IN_PROGRESS;
145149
}
146150

@@ -230,7 +234,9 @@ export class MonitorService extends CoreClientAware implements Disposable {
230234
this.logger.info(
231235
`started monitor to ${this.port?.address} using ${this.port?.protocol}`
232236
);
233-
this.updateClientsSettings({ monitorUISettings: { connected: true } });
237+
this.updateClientsSettings({
238+
monitorUISettings: { connected: true, serialPort: this.port.address },
239+
});
234240
resolve(Status.OK);
235241
return;
236242
}
@@ -397,6 +403,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
397403
monitorUISettings: {
398404
...settings.monitorUISettings,
399405
connected: !!this.duplex,
406+
serialPort: this.port.address,
400407
},
401408
pluggableMonitorSettings: reconciledSettings,
402409
});

0 commit comments

Comments
 (0)