diff --git a/.vscode/settings.json b/.vscode/settings.json index 293ed1e..2d31ad7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "Meshtastic", - "TORADIO" + "TORADIO", + "Vids" ] } \ No newline at end of file diff --git a/meshtastic/util.py b/meshtastic/util.py index 34130d3..d384897 100644 --- a/meshtastic/util.py +++ b/meshtastic/util.py @@ -3,6 +3,9 @@ from collections import defaultdict import serial import serial.tools.list_ports +"""Some devices such as a seger jlink we never want to accidentally open""" +blacklistVids = dict.fromkeys([0x1366]) + def findPorts(): """Find all ports that might have meshtastic devices @@ -11,7 +14,7 @@ def findPorts(): list -- a list of device paths """ l = list(map(lambda port: port.device, - filter(lambda port: port.vid != None, + filter(lambda port: port.vid != None and port.vid not in blacklistVids, serial.tools.list_ports.comports()))) l.sort() return l