Fixed bug in beacon bumping

This commit is contained in:
Jordan Sherer 2018-07-15 16:48:27 -04:00
parent f2b876df49
commit 4c63129876
2 changed files with 10 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);