diff --git a/mainwindow.cpp b/mainwindow.cpp index b9f51a1..26b9dd6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5541,8 +5541,10 @@ bool MainWindow::prepareNextMessageFrame() int sent = count - m_txFrameQueue.count(); ui->startTxButton->setText(QString("Sending (%1/%2)").arg(sent).arg(count)); - // bump beacon - m_nextBeacon = m_nextBeacon.addSecs(15); + if(ui->beaconButton->isChecked()){ + // bump beacon + setBeaconTimer(m_nextBeacon.addSecs(15)); + } return true; } @@ -5624,7 +5626,12 @@ void MainWindow::scheduleBeacon(bool first){ timestamp = timestamp.addSecs(15); } + setBeaconTimer(timestamp); +} + +void MainWindow::setBeaconTimer(QDateTime timestamp){ // set the next beacon timestamp and timer + beaconTimer.stop(); m_nextBeacon = timestamp; beaconTimer.start(QDateTime::currentDateTimeUtc().msecsTo(m_nextBeacon) - 2*1000); } diff --git a/mainwindow.h b/mainwindow.h index 2f1cb02..6676a22 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -258,6 +258,7 @@ private slots: bool isFreqOffsetFree(int f, int bw); int findFreeFreqOffset(int fmin, int fmax, int bw); void scheduleBeacon(bool first=false); + void setBeaconTimer(QDateTime timestamp); void prepareBeacon(); QString calculateDistance(QString const& grid); void on_rptSpinBox_valueChanged(int n);