summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Carlsson <johannes.carlsson@acconeer.com>2020-03-30 13:58:04 +0200
committerJohannes Carlsson <johannes.carlsson@acconeer.com>2020-03-30 13:59:51 +0200
commitca42ff25796472c57004dcf4db5d370517d6fafb (patch)
treeeb2489370974c94032908c99434c59234cfa203f
parent3a6ae5a630589a29af8d8bd45616d7aadb2fb3db (diff)
downloadpyserial-git-ca42ff25796472c57004dcf4db5d370517d6fafb.tar.gz
Correct "interface" property on Linux hosts
The "interface" property should be read from the "usb_interface_path" instead of the "device_path" as the later one is a directory (e.g. /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/ttyUSB1).
-rw-r--r--serial/tools/list_ports_linux.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/serial/tools/list_ports_linux.py b/serial/tools/list_ports_linux.py
index 9346ae9..1a359e9 100644
--- a/serial/tools/list_ports_linux.py
+++ b/serial/tools/list_ports_linux.py
@@ -59,7 +59,7 @@ class SysFS(list_ports_common.ListPortInfo):
self.manufacturer = self.read_line(self.usb_device_path, 'manufacturer')
self.product = self.read_line(self.usb_device_path, 'product')
- self.interface = self.read_line(self.device_path, 'interface')
+ self.interface = self.read_line(self.usb_interface_path, 'interface')
if self.subsystem in ('usb', 'usb-serial'):
self.apply_usb_info()