Skip to content

Commit d147bce

Browse files
committed
SerialPABotBase selector: only include preferred serial ports on macOS/Linux
macOS: filter system builtin serial ports
1 parent b0b21b5 commit d147bce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_SelectorWidget.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ class SerialPABotBase_SelectorWidget : public NoWheelComboBox{
8989
if (port.portName() == "COM1"){
9090
continue;
9191
}
92+
#else // assume macOS or Linux
93+
if (port.portName().startsWith("tty.")) {
94+
continue;
95+
}
96+
#if defined(__APPLE__) // exclude system builtin serial ports
97+
if (port.portName() == "cu.debug-console" ||
98+
port.portName() == "cu.Bluetooth-Incoming-Port"
99+
){
100+
continue;
101+
}
102+
#endif
92103
#endif
93104
m_ports.emplace_back(new SerialPABotBase_Descriptor(port.portName().toStdString()));
94105
}

0 commit comments

Comments
 (0)