summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-27 21:53:14 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-27 21:53:14 (GMT)
commit535189077de67e929a19bd9bbaa588f5628aaccc (patch)
tree5b44fe654e3ef4060f3f805ebe7a1186377f71d6
parente06921bc798c3bb8cab6ae4d9daf033f5d5f4112 (diff)
Send heartbeat imediately upon reception of watchdog device. Then set the timer only when receiving back the heartbeat value
-rw-r--r--kstars/indi/indistd.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/kstars/indi/indistd.cpp b/kstars/indi/indistd.cpp
index 031f38f..5e5bf3d 100644
--- a/kstars/indi/indistd.cpp
+++ b/kstars/indi/indistd.cpp
@@ -135,8 +135,8 @@ void GenericDevice::registerProperty(INDI::Property *prop)
if (connected && nvp->np[0].value > 0)
{
- // Reset timer 15 seconds before it is due
- watchDogTimer->start(nvp->np[0].value*60*1000 - 15*1000);
+ // Send immediately a heart beat
+ watchDogTimer->start(0);
}
}
}
@@ -167,8 +167,8 @@ void GenericDevice::processSwitch(ISwitchVectorProperty * svp)
INumberVectorProperty *nvp = baseDevice->getNumber("WATCHDOG_HEARTBEAT");
if (nvp && nvp->np[0].value > 0)
{
- // Reset timer 15 seconds before it is due
- watchDogTimer->start(nvp->np[0].value*60*1000 - 15*1000);
+ // Send immediately
+ watchDogTimer->start(0);
}
}
}
@@ -648,11 +648,8 @@ void GenericDevice::resetWatchdog()
INumberVectorProperty *nvp = baseDevice->getNumber("WATCHDOG_HEARTBEAT");
if (nvp)
- {
- // Reset timer 15 seconds before it is due
- watchDogTimer->start(nvp->np[0].value*60*1000 - 15*1000);
- clientManager->sendNewNumber(nvp);
- }
+ // Send heartbeat to driver
+ clientManager->sendNewNumber(nvp);
}
DeviceDecorator::DeviceDecorator(GDInterface *iPtr)