INNER CODE UNIT · Python
capture
Chanchaldhiman/CANviz · backend/canviz/cli.py:758
def capture(
interface: InterfaceOpt = "gs_usb",
channel: ChannelOpt = "",
index: IndexOpt = 0,
bitrate: BitrateOpt = 500_000,
output: Annotated[
Optional[Path],
typer.Option("--output", "-o", help="Output file path (default: canviz_YYYYMMDD_HHMMSS.json)"),
] = None,
duration: Annotated[
Optional[float],
typer.Option("--duration", "-d", help="Capture duration in seconds (default: run until Ctrl+C)"),
] = None,
) -> None:
"""
Capture CAN frames to a JSON file.
Records every raw frame (id, dlc, data, timestamp) to disk.