Independently set the watchdog Interval when set
When we receive a set watchdog command, this will now
set the Interval value directly.
Change-Id: I34b82507cbad95f2ad56932d03a48a80b2dfc11d
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/apphandler.cpp b/apphandler.cpp
index d911356..210544c 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -436,6 +436,16 @@
sd_bus_error_free(&error);
reply = sd_bus_message_unref(reply);
+ // Set the Interval for the Watchdog
+ r = sd_bus_call_method(bus, busname, objname, property_iface,
+ "Set", &error, &reply, "ssv",
+ iface, "Interval", "t", timer_ms);
+ if(r < 0) {
+ fprintf(stderr, "Failed to set new expiration time: %s\n",
+ strerror(-r));
+ goto finish;
+ }
+
// Now Enable Watchdog
r = sd_bus_call_method(bus, busname, objname, property_iface,
"Set", &error, &reply, "ssv",
@@ -445,16 +455,6 @@
strerror(-r));
goto finish;
}
-
- // Set watchdog timer
- r = sd_bus_call_method(bus, busname, objname, property_iface,
- "Set", &error, &reply, "ssv",
- iface, "TimeRemaining", "t", timer_ms);
- if(r < 0) {
- fprintf(stderr, "Failed to set new expiration time: %s\n",
- strerror(-r));
- goto finish;
- }
}
finish: