diff --git a/Configuration.ui b/Configuration.ui
index 7647139..13d8184 100644
--- a/Configuration.ui
+++ b/Configuration.ui
@@ -633,23 +633,26 @@ text message.
<html><head/><body><p>Number of minutes between unattended heartbeat transmissions.</p></body></html>
+
+ Disabled
+
minutes
-
+ every
- 5
+ 0
1440
- 1
+ 5
- 15
+ 30
@@ -676,7 +679,7 @@ text message.
minutes
-
+ after
1
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 6e3107e..419a842 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -4381,7 +4381,22 @@ void MainWindow::guiUpdate()
ui->labUTC->setText(utc);
auto delta = t.secsTo(m_nextHeartbeat);
- auto ping = ui->heartbeatButton->isChecked() ? delta > 0 ? QString("%1 s").arg(delta) : "queued!" : m_nextHeartPaused ? "paused" : "disabled";
+ QString ping;
+ if(ui->heartbeatButton->isChecked()){
+ if(heartbeatTimer.isActive()){
+ if(delta > 0){
+ ping = QString("%1 s").arg(delta);
+ } else {
+ ping = "queued!";
+ }
+ } else {
+ ping = "on demand";
+ }
+ } else if (m_nextHeartPaused) {
+ ping = "paused";
+ } else {
+ ping = "disabled";
+ }
ui->labHeartbeat->setText(QString("Next Heartbeat: %1").arg(ping));
auto callLabel = m_config.my_callsign();
@@ -5498,6 +5513,12 @@ void MainWindow::scheduleHeartbeat(bool first){
auto timestamp = DriftingDateTime::currentDateTimeUtc();
auto orig = timestamp;
+ // if we have the heartbeat interval disabled, return early, unless this is a "heartbeat now"
+ if(!m_config.heartbeat() && !first){
+ heartbeatTimer.stop();
+ return;
+ }
+
// remove milliseconds
auto t = timestamp.time();
t.setHMS(t.hour(), t.minute(), t.second());
@@ -8838,7 +8859,7 @@ void MainWindow::processCommandActivity() {
}
// PROCESS HEARTBEAT
- else if (d.cmd == " HEARTBEAT" && ui->heartbeatButton->isChecked()){
+ else if (d.cmd == " HEARTBEAT" && ui->heartbeatButton->isChecked() && ui->autoReplyButton->isChecked()){
reply = QString("%1 HEARTBEAT ACK %2").arg(d.from).arg(Varicode::formatSNR(d.snr));
enqueueHeartbeat(reply);