MCPcopy Create free account
hub / github.com/FastLED/FastLED / list_all_ports

Function list_all_ports

ci/debug/validate_port_kill.py:23–37  ·  view source on GitHub ↗

List all available serial ports.

()

Source from the content-addressed store, hash-verified

21
22
23def list_all_ports() -> list[str]:
24 """List all available serial ports."""
25 ports = serial.tools.list_ports.comports()
26 if not ports:
27 print("No serial ports found")
28 return []
29
30 print("Available serial ports:")
31 for port in ports:
32 print(f" {port.device}")
33 print(f" Description: {port.description}")
34 print(f" Hardware ID: {port.hwid}")
35 print()
36
37 return [port.device for port in ports]
38
39
40def check_port_status(port_name: str) -> bool:

Callers 1

mainFunction · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected