Skip to content

Commit

Permalink
score_ports: Move the "gw-compat" scoring into rank order
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Jun 20, 2024
1 parent 88892e1 commit 91653b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/greaseweazle/tools/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,13 @@ def score_port(x, old_port=None):
elif x.vid == 0x1209 and x.pid == 0x4d69:
# Our very own properly-assigned PID. Guaranteed to be us.
score = 20
elif x.product and "gw-compat" in x.product.lower():
# Device self-reports as "Greaseweazle compatible" via its product
# string. Let's judge it not *quite* as good as the real thing. ;)
score = 19
elif x.vid == 0x1209 and x.pid == 0x0001:
# Our old shared Test PID. It's not guaranteed to be us.
score = 10
if "gw-compat" in x.product.lower():
score = 19
if score > 0 and valid_ser_id(x.serial_number):
# A valid serial id is a good sign unless this is a reopen, and
# the serials don't match!
Expand Down

0 comments on commit 91653b2

Please sign in to comment.