File wfmgen.h¶
FileList > doppler > wfm > wfmgen.h
Go to the source code of this file
The wfmgen composer CLI, exposed as a plain callable. More...
Public Functions¶
| Type | Name |
|---|---|
| int | dp_doppler_wfmgen (int argc, char * argv) Run the wfmgen composer CLI in-process (argv in, exit code out). |
Detailed Description¶
dp_doppler_wfmgen() is the entire body of the wfmgen command-line tool with the process main() stripped off: it takes an argv vector, runs the same parse → compose → write/stream pipeline, and returns the shell exit code. The standalone wfmgen binary is a one-line main shim over it.
It is archived into libdoppler so a downstream that links libdoppler.a — or loads libdoppler.so — can drive the full generator without shelling out. The stream sink is statically linked, so there is no runtime client dependency. And because it is the exact same code path, dp_doppler_wfmgen(argc, argv) is byte-identical to running wfmgen ….
Public Functions Documentation¶
function dp_doppler_wfmgen¶
Run the wfmgen composer CLI in-process (argv in, exit code out).
Parses argv exactly as the wfmgen binary does (--type, --count, --from-file, --output, --record, the file-type/wire/endian flags, the nats:// sink, --realtime pacing, …), composes the waveform, and writes it to the chosen destination (a file, stdout, or a NATS PUB subject). Output is byte-identical to invoking the CLI with the same arguments — it is the same code path, not a reimplementation.
Process-global only in the ways the CLI is, and each is stated:
* it writes to stdout / stderr and creates the --output / --record files;
* it installs SIGINT and SIGTERM handlers for the length of the call, so a stop signal ends the run cleanly instead of killing it mid-write, and puts the caller's own handlers back before it returns, on every exit;
* on Windows it sets stdout to binary mode for the process, because IQ written in text mode is corrupted, and leaves it so.
It registers no atexit hooks, so it is safe to call repeatedly within one process. Not reentrant across threads: it shares stdout and the process's signal handlers.
Parameters:
argcArgument count, includingargv``[0](the program name).argvArgument vector;argv``[0]is used only in diagnostics/usage.
Returns:
0 on success; a non-zero shell exit code on a usage or I/O error (mirrors the CLI: 1 = runtime/I/O failure, 2 = bad arguments).
// Generate a 4096-sample QPSK capture to a file, in-process.
char *av[] = { "wfmgen", "--type", "qpsk", "--count", "4096",
"--output", "out.cf32", NULL };
int rc = dp_doppler_wfmgen(7, av); // rc == 0; out.cf32 written
The documentation for this class was generated from the following file native/inc/doppler/wfm/wfmgen.h