Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions dronecan_gui_tool/setup_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

RUNNING_ON_LINUX = 'linux' in sys.platform.lower()


MACOS_SERIAL_PORTS_FILTER = ['/dev/tty.debug-console', '/dev/tty.wlan-debug', '/dev/tty.Bluetooth-Incoming-Port']
logger = getLogger(__name__)


Expand Down Expand Up @@ -100,7 +100,8 @@ def list_ifaces():
for port in QtSerialPort.QSerialPortInfo.availablePorts():
if sys.platform == 'darwin':
if 'tty' in port.systemLocation():
out[port.systemLocation()] = port.systemLocation()
if port.systemLocation() not in MACOS_SERIAL_PORTS_FILTER:
out[port.systemLocation()] = port.systemLocation()
else:
sys_name = port.systemLocation()
sys_alpha = re.sub(r'[^a-zA-Z0-9]', '', sys_name)
Expand All @@ -114,10 +115,11 @@ def list_ifaces():
out[x] = x

try:
from can import detect_available_configs
for interface in detect_available_configs():
if interface['interface'] == "pcan":
out[interface['channel']] = interface['channel']
if sys.platform != 'darwin':
from can import detect_available_configs
for interface in detect_available_configs():
if interface['interface'] == "pcan":
out[interface['channel']] = interface['channel']
except Exception as ex:
logger.warning('Could not load can interfaces: %s', ex, exc_info=True)

Expand Down