diff options
author | zsquareplusc <cliechti@gmx.net> | 2020-11-19 03:02:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 03:02:46 +0100 |
commit | fecd9310535db64f93f410c0d73a977bf7a14e9e (patch) | |
tree | 4dcffc82c8d92118bc90fec6abf2894d3f098716 | |
parent | a376faeb3ef4d0c26636fdcc5cc72bc5bfa1f24b (diff) | |
parent | 70a6b99fa5eff291bee88caedf1f418dfdd9d0ea (diff) | |
download | pyserial-git-fecd9310535db64f93f410c0d73a977bf7a14e9e.tar.gz |
Merge pull request #546 from chairman888/545-osx-use-iousbhostdevice-instead
list_ports_osx: getting USB info on BigSur/AppleSilicon
-rw-r--r-- | serial/tools/list_ports_osx.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/serial/tools/list_ports_osx.py b/serial/tools/list_ports_osx.py index c91a750..51b4e8c 100644 --- a/serial/tools/list_ports_osx.py +++ b/serial/tools/list_ports_osx.py @@ -271,7 +271,11 @@ def comports(include_links=False): if device: info = list_ports_common.ListPortInfo(device) # If the serial port is implemented by IOUSBDevice - usb_device = GetParentDeviceByType(service, "IOUSBDevice") + # NOTE IOUSBDevice was deprecated as of 10.11 and finally on Apple Silicon + # devices has been completely removed. Thanks to @oskay for this patch. + usb_device = GetParentDeviceByType(service, "IOUSBHostDevice") + if not usb_device: + usb_device = GetParentDeviceByType(service, "IOUSBDevice") if usb_device: # fetch some useful informations from properties info.vid = get_int_property(usb_device, "idVendor", kCFNumberSInt16Type) |