From 31efc56bb0a1669d4452a7cc4769d1a89e6d65ef Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 11 Nov 2024 00:02:47 -0800 Subject: [PATCH] Only report RADE RX once a second to the server. --- src/main.cpp | 7 +++++-- src/main.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ab2aee0a..bdbaa753 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -228,6 +228,7 @@ bool MainApp::OnInit() m_locale.Init(); m_reporters.clear(); + m_reportCounter = 0; if(!wxApp::OnInit()) { @@ -1641,15 +1642,17 @@ void MainFrame::OnTimer(wxTimerEvent &evt) wxGetApp().m_sharedReporterObject && freedvInterface.getCurrentMode() == FREEDV_MODE_RADE && freedvInterface.getSync()) - { + { // Special case for RADE--report 'unk' for callsign so we can // at least report that we're receiving *something*. int64_t freq = wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency; // Only report if there's a valid reporting frequency and if we're not playing // a recording through ourselves (to avoid false reports). - if (freq > 0) + wxGetApp().m_reportCounter = (wxGetApp().m_reportCounter + 1) % 10; + if (freq > 0 && wxGetApp().m_reportCounter == 0) { + wxGetApp().m_reportCounter = 0; if (!g_playFileFromRadio) { wxGetApp().m_sharedReporterObject->addReceiveRecord( diff --git a/src/main.h b/src/main.h index 006f65a9..f445600b 100644 --- a/src/main.h +++ b/src/main.h @@ -222,6 +222,8 @@ class MainApp : public wxApp std::shared_ptr linkStep; wxLocale m_locale; + + int m_reportCounter; protected: };