mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Disable serial monitor for non-SSH network ports
This commit is contained in:
parent
40e7b1db39
commit
3e9448d34b
@ -37,7 +37,13 @@ public class MonitorFactory {
|
||||
|
||||
public AbstractMonitor newMonitor(BoardPort port) {
|
||||
if ("network".equals(port.getProtocol())) {
|
||||
return new NetworkMonitor(port);
|
||||
if ("yes".equals(port.getPrefs().get("ssh_upload"))) {
|
||||
// the board is SSH capable
|
||||
return new NetworkMonitor(port);
|
||||
} else {
|
||||
// SSH not supported, no monitor support
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return new SerialMonitor(port);
|
||||
|
@ -2318,6 +2318,14 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
}
|
||||
|
||||
serialMonitor = new MonitorFactory().newMonitor(port);
|
||||
|
||||
if (serialMonitor == null) {
|
||||
String board = port.getPrefs().get("board");
|
||||
String boardName = BaseNoGui.getPlatform().resolveDeviceByBoardID(BaseNoGui.packages, board);
|
||||
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));
|
||||
return;
|
||||
}
|
||||
|
||||
Base.setIcon(serialMonitor);
|
||||
|
||||
// If currently uploading, disable the monitor (it will be later
|
||||
|
Loading…
Reference in New Issue
Block a user