Add full LG4 (VS986) support

Add productId to the Wireshark dissector and udev rule, adjust the
serial path detection logic to find the right key
(`\Device\LGVZANDNETDIAG1`). Now you do not need to pass `--serial COM4`
anymore.

Reportedly fails in VirtualBox with USB passthrough, but works fine on
Linux. Thanks @invisiblek for testing!
This commit is contained in:
Peter Wu 2015-12-30 10:34:23 +01:00
parent 2d79e1565e
commit 90d89bbe5f
3 changed files with 12 additions and 4 deletions

View file

@ -97,4 +97,5 @@ function lglaf.init()
local usb_product = DissectorTable.get("usb.product");
usb_product:add(0x1004633e, lglaf) -- LG G3 D855
usb_product:add(0x1004627f, lglaf) -- LG G3 VS985
usb_product:add(0x10046298, lglaf) -- LG G4 VS986
end

View file

@ -275,16 +275,21 @@ def detect_serial_path():
try:
path = r'HARDWARE\DEVICEMAP\SERIALCOMM'
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) as key:
return winreg.QueryValueEx(key, r'\Device\LGANDNETDIAG1')[0]
except OSError:
return None
for i in range(winreg.QueryInfoKey(key)[1]):
name, value, value_type = winreg.EnumValue(key, i)
# match both \Device\LGANDNETDIAG1 and \Device\LGVZANDNETDIAG1
name = name.upper()
if name.startswith(r'\DEVICE\LG') and name.endswith('ANDNETDIAG1'):
return value
except OSError: pass
return None
def autodetect_device():
if winreg is not None and 'usb.core' not in sys.modules:
serial_path = detect_serial_path()
_logger.debug("Using serial port: %s", serial_path)
if not serial_path:
raise RuntimeError("Please install LG drivers or PyUSB")
raise RuntimeError("Device not found, try installing LG drivers")
return FileCommunication(serial_path)
else:
if 'usb.core' not in sys.modules:

View file

@ -3,3 +3,5 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", ATTRS{idProduct}=="633e", TAG+="uaccess"
# LG G3 (VS985) in download mode
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", ATTRS{idProduct}=="627f", TAG+="uaccess"
# LG G4 (VS986) in download mode
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", ATTRS{idProduct}=="6298", TAG+="uaccess"