Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53dfc0d

Browse files
Disable serial monitor for non-SSH network ports
1 parent 40e7b1d commit 53dfc0d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
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‎

Lines changed: 8 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /