summaryrefslogtreecommitdiff
path: root/lib/wsprd/wsprd_stream.h
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
commit059831534c7e884f0a607ed86b582fd00d821731 (patch)
tree76bcb67a78f8aa2654fd34c2ad801a62136b0170 /lib/wsprd/wsprd_stream.h
parentd83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff)
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'lib/wsprd/wsprd_stream.h')
-rw-r--r--lib/wsprd/wsprd_stream.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/wsprd/wsprd_stream.h b/lib/wsprd/wsprd_stream.h
new file mode 100644
index 00000000..0eed120e
--- /dev/null
+++ b/lib/wsprd/wsprd_stream.h
@@ -0,0 +1,33 @@
+/*
+ * wsprd streaming layer — public API consumed by wsprd.c.
+ * See wsprd_stream.c for protocol + scope notes.
+ */
+#ifndef WSPRD_STREAM_H
+#define WSPRD_STREAM_H
+
+struct wsprd_stream_config {
+ char date[7]; // YYMMDD\0
+ char uttime[5]; // HHMM\0
+ double dialfreq; // MHz
+ int wspr_type; // 2 or 15
+ char mycall[13]; // up to 12-char callsign + NUL
+ char mygrid[7]; // up to 6-char grid + NUL
+ int configure_received;
+};
+
+void wsprd_stream_emit_ready(void);
+void wsprd_stream_emit_decode(const char *date, const char *uttime,
+ float snr, float dt, double freq,
+ int drift, const char *message);
+void wsprd_stream_emit_decode_finished(const char *date, const char *uttime);
+void wsprd_stream_emit_error(const char *msg);
+void wsprd_stream_emit_error_code(const char *code, const char *detail);
+
+// Reads WSJT header + frames from stdin until halt or EOF. On success,
+// populates *cfg and the supplied I/Q buffers (idat/qdat must hold
+// at least 46080 floats each). Returns the number of complex samples
+// populated (nfft2 = 46080), or 1 on protocol error.
+unsigned long wsprd_stream_read(struct wsprd_stream_config *cfg,
+ float *idat, float *qdat);
+
+#endif