MCPcopy Index your code
hub / github.com/arduino/Arduino / resumeOrCloseSerialMonitor

Method resumeOrCloseSerialMonitor

app/src/processing/app/Editor.java:2105–2138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2103 }
2104
2105 private void resumeOrCloseSerialMonitor() {
2106 // Return the serial monitor window to its initial state
2107 if (serialMonitor != null) {
2108 try {
2109 Thread.sleep(200);
2110 } catch (InterruptedException e) {
2111 // noop
2112 }
2113 BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
2114 long sleptFor = 0;
2115 while (boardPort == null && sleptFor < MAX_TIME_AWAITING_FOR_RESUMING_SERIAL_MONITOR) {
2116 try {
2117 Thread.sleep(100);
2118 sleptFor += 100;
2119 boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
2120 } catch (InterruptedException e) {
2121 // noop
2122 }
2123 }
2124 try {
2125 if (serialMonitor != null) {
2126 serialMonitor.resume(boardPort);
2127 if (boardPort == null) {
2128 serialMonitor.close();
2129 handleSerial();
2130 } else {
2131 serialMonitor.resume(boardPort);
2132 }
2133 }
2134 } catch (Exception e) {
2135 statusError(e);
2136 }
2137 }
2138 }
2139
2140 private void resumeOrCloseSerialPlotter() {
2141 // Return the serial plotter window to its initial state

Callers 1

runMethod · 0.80

Calls 8

getDiscoveryManagerMethod · 0.95
getMethod · 0.95
handleSerialMethod · 0.95
statusErrorMethod · 0.95
sleepMethod · 0.80
resumeMethod · 0.80
findMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected