Files
radar_system/data_acq_and_processing/kamil_adc_collector
2026-06-11 13:02:02 +03:00
..
2026-06-11 13:02:02 +03:00
2026-06-11 13:02:02 +03:00
2026-06-11 13:02:02 +03:00
2026-06-11 13:02:02 +03:00

Kamil ADC collector

Standalone acquisition binary for the L-Card E-502 ADC. It captures the dual-channel main + reference IQ stream and publishes it as 8-byte framed packets over a PTY, which the Python kamil_adc producer (python_app/hardware_full/kamil_adc) reads and processes.

This is the data source for radar.model == "kamil_adc"; it is the Kamil ADC counterpart to the C++ sweep_orchestrator used by LibreVNA devices.

Layout

Path Contents
src/ Collector implementation (main.cpp) and the PTY / capture-file writers.
include/ Headers for the writers.
vendor/lcard/ L-Card X502/E502 SDK headers (x502api.h, e502api.h, lcard_pstdint.h), vendored verbatim so the collector builds with no external include path.

The sources under src/ and include/ are imported verbatim from the original standalone tool and are kept byte-for-byte identical — the wire format and acquisition behaviour are unchanged; only their home moved into this repo.

Build

make kamil_adc_collector      # -> build/bin/kamil_adc_collector

It is not part of make all; start.sh builds it automatically when the active config selects radar.model == "kamil_adc". The build is self-contained: it needs only the vendored headers and links -ldl -lutil -lpthread.

Runtime

The collector loads the proprietary libx502api.so / libe502api.so at run time via dlopen, so those libraries must be on LD_LIBRARY_PATH. The Kamil ADC service prepends ~/.local/lib (their default install location) unless the config pins LD_LIBRARY_PATH in radar.kamil_adc.env.

The command-line arguments (capture profile, clocking, the do8_freq_ref reference overlay, etc.) are supplied by radar.kamil_adc.args in the run config; the service appends the generated tty:<path> argument.