Add 'timeMs' field to /privet/info local API
Added the local device time field to the Info response. The timestamp
is a time in milliseconds since Epoch (similar to how the time is
used with the cloud server).
BUG: 26160070
Change-Id: I3059f2880dc2aa4c1990bbe662e8c1057b1aadc1
Reviewed-on: https://weave-review.googlesource.com/1922
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/privet/privet_handler.h b/src/privet/privet_handler.h
index fc024d1..5241233 100644
--- a/src/privet/privet_handler.h
+++ b/src/privet/privet_handler.h
@@ -12,6 +12,7 @@
#include <base/macros.h>
#include <base/memory/weak_ptr.h>
#include <base/scoped_observer.h>
+#include <base/time/default_clock.h>
#include "src/privet/cloud_delegate.h"
@@ -42,7 +43,8 @@
PrivetHandler(CloudDelegate* cloud,
DeviceDelegate* device,
SecurityDelegate* pairing,
- WifiDelegate* wifi);
+ WifiDelegate* wifi,
+ base::Clock* clock = nullptr);
~PrivetHandler() override;
void OnTraitDefsChanged() override;
@@ -134,6 +136,8 @@
DeviceDelegate* device_{nullptr};
SecurityDelegate* security_{nullptr};
WifiDelegate* wifi_{nullptr};
+ base::DefaultClock default_clock_;
+ base::Clock* clock_{nullptr};
struct HandlerParameters {
ApiHandler handler;