Only report RADE RX once a second to the server.

ms-report-rade
Mooneer Salem 2024-11-11 00:02:47 -08:00
parent f62345538e
commit 31efc56bb0
2 changed files with 7 additions and 2 deletions

View File

@ -228,6 +228,7 @@ bool MainApp::OnInit()
m_locale.Init(); m_locale.Init();
m_reporters.clear(); m_reporters.clear();
m_reportCounter = 0;
if(!wxApp::OnInit()) if(!wxApp::OnInit())
{ {
@ -1641,15 +1642,17 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
wxGetApp().m_sharedReporterObject && wxGetApp().m_sharedReporterObject &&
freedvInterface.getCurrentMode() == FREEDV_MODE_RADE && freedvInterface.getCurrentMode() == FREEDV_MODE_RADE &&
freedvInterface.getSync()) freedvInterface.getSync())
{ {
// Special case for RADE--report 'unk' for callsign so we can // Special case for RADE--report 'unk' for callsign so we can
// at least report that we're receiving *something*. // at least report that we're receiving *something*.
int64_t freq = wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency; int64_t freq = wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency;
// Only report if there's a valid reporting frequency and if we're not playing // Only report if there's a valid reporting frequency and if we're not playing
// a recording through ourselves (to avoid false reports). // 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) if (!g_playFileFromRadio)
{ {
wxGetApp().m_sharedReporterObject->addReceiveRecord( wxGetApp().m_sharedReporterObject->addReceiveRecord(

View File

@ -222,6 +222,8 @@ class MainApp : public wxApp
std::shared_ptr<LinkStep> linkStep; std::shared_ptr<LinkStep> linkStep;
wxLocale m_locale; wxLocale m_locale;
int m_reportCounter;
protected: protected:
}; };