diff options
author | Добрый Ээх <bukharaev@gmail.com> | 2016-10-20 10:14:44 +0300 |
---|---|---|
committer | Добрый Ээх <bukharaev@gmail.com> | 2016-10-20 10:22:55 +0300 |
commit | 2133dc2a55f2c0254456df7578c8884899d71453 (patch) | |
tree | f8a3efbff94dd121eaecec4b13f1ab2d18befd2e /tracking | |
parent | 97262e1990ccdedb8eb6edb53b2b89505958475c (diff) |
add required accuracy for gps reporter
Diffstat (limited to 'tracking')
-rw-r--r-- | tracking/reporter.cpp | 4 | ||||
-rw-r--r-- | tracking/tracking_tests/reporter_test.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tracking/reporter.cpp b/tracking/reporter.cpp index 8e2b9a9991..b161b4e3d6 100644 --- a/tracking/reporter.cpp +++ b/tracking/reporter.cpp @@ -12,6 +12,7 @@ namespace { +double constexpr kRequiredHorizontalAccuracy = 10.0; double constexpr kMinDelaySeconds = 1.0; double constexpr kReconnectDelaySeconds = 60.0; size_t constexpr kRealTimeBufferSize = 60; @@ -56,6 +57,9 @@ void Reporter::AddLocation(location::GpsInfo const & info) { lock_guard<mutex> lg(m_mutex); + if (info.m_horizontalAccuracy > kRequiredHorizontalAccuracy) + return; + if (info.m_timestamp < m_lastGpsTime + kMinDelaySeconds) return; diff --git a/tracking/tracking_tests/reporter_test.cpp b/tracking/tracking_tests/reporter_test.cpp index 2492f32e9d..685b4f19f7 100644 --- a/tracking/tracking_tests/reporter_test.cpp +++ b/tracking/tracking_tests/reporter_test.cpp @@ -25,6 +25,7 @@ void TransferLocation(Reporter & reporter, TestSocket & testSocket, double times gpsInfo.m_timestamp = timestamp; gpsInfo.m_latitude = latidute; gpsInfo.m_longitude = longtitude; + gpsInfo.m_horizontalAccuracy = 1.0; reporter.AddLocation(gpsInfo); vector<uint8_t> buffer; |