From d495ac6dcb156b9f2f352a660e1f987e4f7d24c3 Mon Sep 17 00:00:00 2001 From: Jens Lorenz Date: Wed, 16 Sep 2015 13:03:05 +0200 Subject: Notification time calculation of watchdog fixed Signed-off-by: Jens Lorenz --- AudioManagerDaemon/src/CAmWatchdog.cpp | 9 +++++---- 1 file 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)) -- cgit v1.2.1