| 25 | |
| 26 | |
| 27 | def print_devices(devices: list[DeviceInfo], errors: list[str] | None = None) -> None: |
| 28 | if not devices: |
| 29 | print("No RGB-D cameras found.") |
| 30 | for i, info in enumerate(devices): |
| 31 | backend = info.get("backend", "unknown") |
| 32 | print(f"[{i}] {backend}: {info.get('name', 'unknown')}") |
| 33 | for key in [ |
| 34 | "serial", |
| 35 | "uid", |
| 36 | "physical_port", |
| 37 | "usb_id", |
| 38 | "product_id", |
| 39 | "product_line", |
| 40 | "connection_type", |
| 41 | "usb_type", |
| 42 | "firmware", |
| 43 | "hardware", |
| 44 | ]: |
| 45 | if key in info: |
| 46 | print(f" {key}: {info[key]}") |
| 47 | for error in errors or []: |
| 48 | print(f" {error}") |
| 49 | |
| 50 | |
| 51 | def _selector(args: argparse.Namespace, backend: str) -> str | None: |