# {py:mod}`haniwers.v1.cli.daq`

```{py:module} haniwers.v1.cli.daq
```

```{autodoc2-docstring} haniwers.v1.cli.daq
:allowtitles:
```

## Module Contents

### Functions

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`daq <haniwers.v1.cli.daq.daq>`
  - ```{autodoc2-docstring} haniwers.v1.cli.daq.daq
    :summary:
    ```
````

### API

````{py:function} daq(ctx: typer.Context, config: typing.Optional[pathlib.Path] = typer.Option(None, '--config', help='Configuration file path (config.toml, .env.haniwers, etc). If not specified, ConfigLoader searches default locations.'), port: typing.Optional[str] = typer.Option(None, '--port', help="Serial port path for OSECHI detector (e.g., /dev/ttyUSB0, COM3). Use 'haniwers-v1 port list' to find available ports.", rich_help_panel='Device Settings'), baudrate: typing.Optional[int] = typer.Option(None, '--baudrate', min=1, help='Serial communication baud rate in bits per second (e.g., 9600, 115200).', rich_help_panel='Device Settings'), timeout: typing.Optional[float] = typer.Option(None, '--timeout', min=0.1, help='Serial read timeout in seconds (e.g., 1.0, 2.0).', rich_help_panel='Device Settings'), device_label: typing.Optional[str] = typer.Option(None, '--device-label', help='Device identifier label for logging and documentation.', rich_help_panel='Device Settings'), workspace: typing.Optional[pathlib.Path] = typer.Option(None, '--workspace', help='Output directory for data files. Timestamped subdirectory created automatically.', rich_help_panel='Sampler Settings'), filename_prefix: typing.Optional[str] = typer.Option(None, '--filename-prefix', help="Prefix for output file names (e.g., 'run001').", rich_help_panel='Sampler Settings'), filename_suffix: typing.Optional[str] = typer.Option(None, '--filename-suffix', help="File extension/suffix for output files (e.g., '.csv').", rich_help_panel='Sampler Settings'), events_per_file: typing.Optional[int] = typer.Option(None, '--events-per-file', min=1, help='Number of detector events per output file before rollover.', rich_help_panel='Sampler Settings'), number_of_files: typing.Optional[int] = typer.Option(None, '--number-of-files', min=1, help='Maximum number of files to create in a single DAQ session.', rich_help_panel='Sampler Settings'), stream_mode: bool = typer.Option(False, '--stream-mode', help='Enable continuous streaming mode (write immediately, no buffering).', rich_help_panel='Sampler Settings'), mode: typing.Optional[str] = typer.Option(None, '--mode', help="Data acquisition mode: 'count_based' (fixed number of events) or 'time_based' (fixed duration). If not specified, uses mode from [sampler] config section (default: count_based).", rich_help_panel='Sampler Settings'), duration: typing.Optional[float] = typer.Option(None, '--duration', min=0.1, help='Acquisition duration in seconds for time_based mode. When specified, automatically switches to time_based mode. Overrides mode setting from config file.', rich_help_panel='Sampler Settings'), mock: bool = typer.Option(False, '--mock', help='Use RandomMocker instead of real device for testing (no hardware required).', rich_help_panel='Testing')) -> None
:canonical: haniwers.v1.cli.daq.daq

```{autodoc2-docstring} haniwers.v1.cli.daq.daq
```
````
