Skip to content

Commit

Permalink
Fix windows connection issue to be more picky (#76)
Browse files Browse the repository at this point in the history
Returning windows to 1.0 connection style where it would match VID:PID pair. maintains improved connection logic for Linux / Mac OS (mfg string) and ignores this extra test on windows (which doesn't have access to mfg string).
  • Loading branch information
trentgill authored Jul 6, 2021
1 parent 9894a7b commit c83b624
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/druid/crow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

def find_serial_port(hwid):
for portinfo in serial.tools.list_ports.comports():
if os.name == "nt": # windows doesn't know anything about the port
return portinfo
elif hwid in portinfo.hwid: # more precise detection for linux/macos
if "crow: telephone line" in portinfo.product:
if hwid in portinfo.hwid: # must match VID:PID pair (STM32 CDC Device)
if os.name == "nt": # windows doesn't know the name of the device
return portinfo
if "crow: telephone line" in portinfo.product: # more precise detection for linux/macos
return portinfo
raise DeviceNotFoundError(f"can't find crow device")

Expand Down

0 comments on commit c83b624

Please sign in to comment.