From 39315e8d11f85cd9c6d281dd3744e9aca63f7d21 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sun, 5 Apr 2020 11:49:34 -0400 Subject: [PATCH] Added CQ as a directed command (directed to @ALLCALL) in the API --- mainwindow.cpp | 30 +++++++++++++++++++++++++++--- tcp.py | 4 ++++ varicode.cpp | 1 + 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 0b56bf2..c7a0851 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4950,8 +4950,26 @@ void MainWindow::processDecodedLine(QByteArray t){ // this is a cq with a standard or compound call, ala "KN4CRD/P: @ALLCALL CQ CQ CQ" cd.cqTimestamp = DriftingDateTime::currentDateTimeUtc(); - // it is not processed elsewhere, so we need to just log it here. - logCallActivity(cd, true); + // convert CQ to a directed command and process... + cmd.from = cd.call; + cmd.to = "@ALLCALL"; + cmd.cmd = " CQ"; + cmd.snr = cd.snr; + cmd.bits = cd.bits; + cmd.grid = cd.grid; + cmd.dial = cd.dial; + cmd.offset = cd.offset; + cmd.utcTimestamp = cd.utcTimestamp; + cmd.tdrift = cd.tdrift; + cmd.submode = cd.submode; + cmd.text = decodedtext.message(); + + // TODO: check bits so we only auto respond to "finished" cqs + m_rxCommandQueue.append(cmd); + + // since this is no longer processed here we omit logging it here. + // if we change this behavior, we'd change this back to logging here. + // logCallActivity(cd, true); // notification for cq tryNotify("cq"); @@ -11035,7 +11053,7 @@ void MainWindow::processCommandActivity() { // we're only responding to allcalls if we are participating in the allcall group // but, don't avoid for heartbeats...those are technically allcalls but are processed differently - if(isAllCall && m_config.avoid_allcall() && d.cmd != " HB" && d.cmd != " HEARTBEAT"){ + if(isAllCall && m_config.avoid_allcall() && d.cmd != " CQ" && d.cmd != " HB" && d.cmd != " HEARTBEAT"){ continue; } @@ -11419,6 +11437,12 @@ void MainWindow::processCommandActivity() { continue; } + // PROCESS CQ + else if (d.cmd == " CQ"){ + qDebug() << "skipping incoming cq" << d.text; + continue; + } + // PROCESS MSG else if (d.cmd == " MSG" && !isAllCall){ diff --git a/tcp.py b/tcp.py index 9e26483..fa1c8b1 100644 --- a/tcp.py +++ b/tcp.py @@ -30,6 +30,10 @@ class Client(object): if not typ: return + if typ in ('RX.ACTIVITY',): + # skip + return + print('->', typ) if value: diff --git a/varicode.cpp b/varicode.cpp index d90a99a..2800a43 100644 --- a/varicode.cpp +++ b/varicode.cpp @@ -47,6 +47,7 @@ QMap directed_cmds = { // ?*^&@ {" HEARTBEAT", -1 }, // this is my heartbeat (unused except for faux processing of HBs as directed commands) {" HB", -1 }, // this is my heartbeat (unused except for faux processing of HBs as directed commands) + {" CQ", -1 }, // this is my cq (unused except for faux processing of CQs as directed commands) {" SNR?", 0 }, // query snr {"?", 0 }, // compat