feat: add port-finder for circuitPython data-port
This commit is contained in:
18
port-finder.py
Executable file
18
port-finder.py
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
import serial.tools.list_ports
|
||||||
|
from serial.tools.list_ports_common import ListPortInfo
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
ports = serial.tools.list_ports.comports()
|
||||||
|
for port in ports:
|
||||||
|
if port.interface and port.interface.startswith("CircuitPython CDC2"): # CDC2 is the data-port
|
||||||
|
print(f"Port: {port.device}")
|
||||||
|
print(f" Description: {port.description}")
|
||||||
|
print(f" Manufacturer: {port.manufacturer}")
|
||||||
|
print(f" VID: {port.vid}")
|
||||||
|
print(f" PID: {port.pid}")
|
||||||
|
print(f" Serial Number: {port.serial_number}")
|
||||||
|
print(f" Location: {port.location}")
|
||||||
|
print(f" Interface: {port.interface}")
|
||||||
|
print()
|
||||||
Reference in New Issue
Block a user