Skip to content

Commit

Permalink
nicer serial selection on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Sep 18, 2024
1 parent 9731348 commit 2da4710
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dronecan_gui_tool/setup_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from logging import getLogger
from collections import OrderedDict
from itertools import count
import re


STANDARD_BAUD_RATES = 9600, 115200, 460800, 921600, 1000000, 3000000
Expand Down Expand Up @@ -101,7 +102,11 @@ def list_ifaces():
if 'tty' in port.systemLocation():
out[port.systemLocation()] = port.systemLocation()
else:
out[port.description()] = port.systemLocation()
sys_name = port.systemLocation()
sys_alpha = re.sub(r'[^a-zA-Z0-9]', '', sys_name)
description = port.description()
# show the COM port in parentheses to make it clearer which port it is
out["%s (%s)" % (description, sys_alpha)] = sys_name

mifaces = _mavcan_interfaces()
mifaces += ["mcast:0", "mcast:1"]
Expand Down

0 comments on commit 2da4710

Please sign in to comment.