From 059831534c7e884f0a607ed86b582fd00d821731 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sat, 26 Sep 2026 23:24:03 +0200 Subject: New upstream version 3.2.0~rc1+dfsg --- DecoderIpc.hpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 DecoderIpc.hpp (limited to 'DecoderIpc.hpp') diff --git a/DecoderIpc.hpp b/DecoderIpc.hpp new file mode 100644 index 00000000..775ec26c --- /dev/null +++ b/DecoderIpc.hpp @@ -0,0 +1,52 @@ +#ifndef DECODER_IPC_HPP +#define DECODER_IPC_HPP + +#include +#include + +#include + +#include "commons.h" + +namespace DecoderIpc +{ + // FT8 reads the complete 15-second buffer even when decoding starts earlier. + constexpr std::size_t Ft8SampleCount {15 * RX_SAMPLE_RATE}; + + struct Ft8MtdPayload + { + std::array samples {}; + decoder_params_t params {}; + }; + + struct Completion + { + qint32 synchronized; + qint32 decoded; + qint32 average; + qint32 generation; + }; + + qint32 nextGeneration (qint32 current); + bool hasUsableSize (qint64 size); + bool hasShutdownControlSize (qint64 size); + qint32 state (shared_dec_data_t const& shared); + qint32 generation (shared_dec_data_t const& shared); + qint32 progress (shared_dec_data_t const& shared); + qint32 protocolVersion (shared_dec_data_t const& shared); + void initialize (shared_dec_data_t& shared); + void shutdown (shared_dec_data_t& shared); + void shutdown (decoder_ipc_control_t& control); + void shutdownControl (void * control); + bool publish (shared_dec_data_t& shared, dec_data_t const& payload, + bool copySamples, qint32 generation); + bool publishFt8Mtd (shared_dec_data_t& shared, + Ft8MtdPayload const& payload, qint32 generation); + bool claim (shared_dec_data_t& shared, qint32& generation); + bool finish (shared_dec_data_t& shared, qint32 generation); + bool consume (shared_dec_data_t& shared, qint32 generation); + bool parseStart (QByteArray line, qint32 * generation); + bool parseCompletion (QByteArray line, Completion * completion); +} + +#endif -- cgit v1.2.3