buffet: Allow configurable polling period
While here, switch to using a repeating timer, which is cleaner.
BUG=brillo:564,brillo:522
TEST=buffet_Registration passes. Can touch the polling period config
flag and see that polling period changes.
Change-Id: I8d0cca5d38e8ba91dad1a97311cc20603e300654
Reviewed-on: https://chromium-review.googlesource.com/260920
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
diff --git a/buffet/buffet_config.h b/buffet/buffet_config.h
index 539191e..550f0da 100644
--- a/buffet/buffet_config.h
+++ b/buffet/buffet_config.h
@@ -30,6 +30,7 @@
std::string default_description() const { return default_description_; }
std::string default_location() const { return default_location_; }
std::string model_id() const { return model_id_; }
+ uint64_t polling_period_ms() const { return polling_period_ms_; }
private:
std::string client_id_{"58855907228.apps.googleusercontent.com"};
@@ -43,6 +44,7 @@
std::string default_description_{"A development device"};
std::string default_location_{"my desk"};
std::string model_id_{"AAA"};
+ uint64_t polling_period_ms_{7000};
DISALLOW_COPY_AND_ASSIGN(BuffetConfig);
};