Skip to content

Commit 2891553

Browse files
committed
list_devices: adds support for several com ports
After the firmware change in the official PPK2 application 4.2.0, the device now enumerates two serial ports: one for data and commands, the other for a debug shell which is not used in this library. This forces connection with the port on endpoint 1.
1 parent 8c9459d commit 2891553

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ppk2_api/ppk2_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ def list_devices():
219219
devices = [
220220
(port.device, port.serial_number[:8])
221221
for port in ports
222-
if port.description.startswith("nRF Connect USB CDC ACM")
222+
if port.description.startswith("nRF Connect USB CDC ACM") and port.location.endswith("1")
223223
]
224224
else:
225225
devices = [
226226
(port.device, port.serial_number[:8])
227227
for port in ports
228-
if port.product == "PPK2"
228+
if port.product == "PPK2" and port.location.endswith("1")
229229
]
230230
return devices
231231

0 commit comments

Comments
 (0)