diff options
author | Katz Yamada <kyamada@codeaurora.org> | 2017-04-10 16:16:46 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-11 16:12:59 -0700 |
commit | f7a8f2cded84e523eab7219bec3d25c325d95690 (patch) | |
tree | 7302f6760de8b4fbb0583d00a01b2ff9609d22a0 /core/SystemStatus.h | |
parent | f3a58cea24305039987b3f4394486259f125f66d (diff) | |
download | gps-f7a8f2cded84e523eab7219bec3d25c325d95690.tar.gz |
SystemStatus - Add reported UTC timestamp in report
Add reported UTC timestamp field in systemstatus' report
data structure. It indicates the system UTC time when the
information was last received from provider such as modem.
Change-Id: I31beb64958c980242ea65fb9a602e18985ad17e1
CRs-Fixed: 2012926
Diffstat (limited to 'core/SystemStatus.h')
-rw-r--r-- | core/SystemStatus.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/SystemStatus.h b/core/SystemStatus.h index f001f61..e8cb197 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -49,8 +49,16 @@ namespace loc_core class SystemStatusItemBase { public: - timespec mUtcTime; - SystemStatusItemBase(timespec utctime) : mUtcTime(utctime) { }; + timespec mUtcTime; // UTC timestamp when this info was last updated + timespec mUtcReported; // UTC timestamp when this info was reported + + SystemStatusItemBase() { + timeval tv; + gettimeofday(&tv, NULL); + mUtcTime.tv_sec = tv.tv_sec; + mUtcTime.tv_nsec = tv.tv_usec *1000ULL; + mUtcReported = mUtcTime; + }; virtual ~SystemStatusItemBase() { }; virtual void dump(void) { }; }; @@ -61,9 +69,7 @@ public: UlpLocation mLocation; GpsLocationExtended mLocationEx; SystemStatusLocation(const UlpLocation& location, - const GpsLocationExtended& locationEx, - const timespec& ts) : - SystemStatusItemBase(ts), + const GpsLocationExtended& locationEx) : mLocation(location), mLocationEx(locationEx){ }; bool equals(SystemStatusLocation& peer); |