Skip to content

Commit 3e9448d

Browse files
sandeepmistrycmaglie
authored andcommitted
Disable serial monitor for non-SSH network ports
1 parent 40e7b1d commit 3e9448d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/src/cc/arduino/packages/MonitorFactory.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ public class MonitorFactory {
3737

3838
public AbstractMonitor newMonitor(BoardPort port) {
3939
if ("network".equals(port.getProtocol())) {
40-
return new NetworkMonitor(port);
40+
if ("yes".equals(port.getPrefs().get("ssh_upload"))) {
41+
// the board is SSH capable
42+
return new NetworkMonitor(port);
43+
} else {
44+
// SSH not supported, no monitor support
45+
return null;
46+
}
4147
}
4248

4349
return new SerialMonitor(port);

app/src/processing/app/Editor.java

+8
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,14 @@ public void handleSerial() {
23182318
}
23192319

23202320
serialMonitor = new MonitorFactory().newMonitor(port);
2321+
2322+
if (serialMonitor == null) {
2323+
String board = port.getPrefs().get("board");
2324+
String boardName = BaseNoGui.getPlatform().resolveDeviceByBoardID(BaseNoGui.packages, board);
2325+
statusError(I18n.format(tr("Serial monitor is not supported on network ports such as {0} for the {1} in this release"), PreferencesData.get("serial.port"), boardName));
2326+
return;
2327+
}
2328+
23212329
Base.setIcon(serialMonitor);
23222330

23232331
// If currently uploading, disable the monitor (it will be later

0 commit comments

Comments
 (0)