summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Lorenz <jlorenz@de.adit-jv.com>2015-09-16 13:03:05 +0200
committerChristian Linke <christian.linke@bmw.de>2015-10-06 19:28:39 +0100
commitd495ac6dcb156b9f2f352a660e1f987e4f7d24c3 (patch)
tree559601a9f1a6b6037c2b5457da136acea708ea80
parenta2567bc1e0d3d5521f2a135f96baffa8779b4ea8 (diff)
downloadaudiomanager-d495ac6dcb156b9f2f352a660e1f987e4f7d24c3.tar.gz
Notification time calculation of watchdog fixed
Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
-rwxr-xr-xAudioManagerDaemon/src/CAmWatchdog.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/AudioManagerDaemon/src/CAmWatchdog.cpp b/AudioManagerDaemon/src/CAmWatchdog.cpp
index 830517d..4ac890f 100755
--- a/AudioManagerDaemon/src/CAmWatchdog.cpp
+++ b/AudioManagerDaemon/src/CAmWatchdog.cpp
@@ -56,11 +56,12 @@ CAmWatchdog::CAmWatchdog(CAmSocketHandler* CAmSocketHandler) :
if (watchdogTimeout > 0)
{
timespec timeout;
- logInfo("CAmWatchdog::CAmWatchdog setting watchdog timeout to ", watchdogTimeout, " museconds");
- //calulate the half cycle as the right interval to trigger the watchdog.
- timeout.tv_sec = watchdogTimeout / 2000000;
- timeout.tv_nsec = (watchdogTimeout % 1000000) * 500;
+ //calculate the half cycle as the right interval to trigger the watchdog.
+ timeout.tv_sec = (watchdogTimeout / 2) / 1000000;
+ timeout.tv_nsec = ((watchdogTimeout / 2) % 1000000) * 1000;
+ logInfo("CAmWatchdog::CAmWatchdog setting watchdog timeout:", watchdogTimeout, "us. Notification set to:",
+ timeout.tv_sec, "sec and", timeout.tv_nsec, "ns");
//add the timer here
if (mpCAmSocketHandler->addTimer(timeout, &TimerCallback, mHandle, NULL))