Skip to content

Commit

Permalink
Add test harness script
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy committed Jan 22, 2025
1 parent 4af24c8 commit 188d8c4
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 239 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ find_file(COMMON_LOGGER_SOURCE_FILE logger.cpp ${COMMON_INCLUDE_DIR})

add_subdirectory(decode)
add_subdirectory(publish)
add_subdirectory(audio-src)
11 changes: 0 additions & 11 deletions audio-src/CMakeLists.txt

This file was deleted.

110 changes: 0 additions & 110 deletions audio-src/main.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions audio-src/sink.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions audio-src/sink.h

This file was deleted.

2 changes: 1 addition & 1 deletion common/notifier.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <QDebug>
#include <QSocketNotifier>

#include <csignal>
#include <qsocketnotifier.h>
#include <sys/socket.h>
#include <unistd.h>

Expand Down
8 changes: 5 additions & 3 deletions decode/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ Decoder::Decoder(const QString &station_id, const QString &publisher,
if (burstMode) {
DBG("Connecting audioReceived signal to burst OQPSK demodulator");

hunter->disable();
connect(this, SIGNAL(audioReceived(const QByteArray &, quint32)),
burstOqpskDemod, SLOT(dataReceived(const QByteArray &, quint32)));
connect(burstOqpskDemod,
SIGNAL(processDemodulatedSoftBits(const QVector<short> &)), aerol,
SLOT(processDemodulatedSoftBits(const QVector<short> &)));
connect(burstOqpskDemod, SIGNAL(SignalStatus(bool)), hunter,
SLOT(updatesSignalStatus(bool)));
SLOT(updatedSignalStatus(bool)));
connect(hunter, SIGNAL(newFreqCenter(double)), burstOqpskDemod,
SLOT(CenterFreqChangedSlot(double)));
} else {
Expand All @@ -137,13 +138,14 @@ Decoder::Decoder(const QString &station_id, const QString &publisher,
if (burstMode) {
DBG("Connecting audioReceived signal to burst MSK demodulator");

connect(this, SIGNAL(audioReceived(const QByteArrau &, quint32)),
hunter->disable();
connect(this, SIGNAL(audioReceived(const QByteArray &, quint32)),
burstMskDemod, SLOT(dataReceived(const QByteArray &, quint32)));
connect(burstMskDemod,
SIGNAL(processDemodulatedSoftBits(const QVector<short> &)), aerol,
SLOT(processDemodulatedSoftBits(const QVector<short> &)));
connect(burstMskDemod, SIGNAL(SignalStatus(bool)), hunter,
SLOT(updateSingalStatus(bool)));
SLOT(updatedSignalStatus(bool)));
connect(hunter, SIGNAL(newFreqCenter(double)), burstMskDemod,
SLOT(CenterFreqChangedSlot(double)));
} else {
Expand Down
2 changes: 2 additions & 0 deletions decode/hunter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ void SignalHunter::handleDcd(bool dcd) {
}

void SignalHunter::updatedSignalStatus(bool gotasignal) {
if (!enabled) return;

if (gotasignal) {
iterationsSinceSignal = 0;
} else {
Expand Down
4 changes: 4 additions & 0 deletions decode/hunter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class SignalHunter : public QObject {
SignalHunter(quint32 maxTries, QObject *parent = nullptr);
~SignalHunter();

void enable() { enabled = true; }
void disable() { enabled = false; }

void setParams(quint32 minFreq, quint32 maxFreq, quint32 bandwidth) {
this->minFreq = minFreq;
this->maxFreq = maxFreq;
Expand All @@ -21,6 +24,7 @@ public slots:
void handleDcd(bool dcd);

private:
bool enabled;
bool lastDcd;

quint32 maxTries;
Expand Down
Loading

0 comments on commit 188d8c4

Please sign in to comment.