summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-11 23:21:14 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-11 23:21:14 -0700
commitb64feb2b73ac985dc7b0f7c4748d007d7cbae170 (patch)
tree1b3a83f524e56d26d47153bc6842f0b0de782284 /core
parentf6ed7637c38b3d0ba6559b49457c110dae92e0fa (diff)
parentc30e7c5e6304a15b6522f37f30bdb813c20833a6 (diff)
downloadgps-b64feb2b73ac985dc7b0f7c4748d007d7cbae170.tar.gz
Merge "Set SV in use mask based on final fixes"
Diffstat (limited to 'core')
-rw-r--r--core/LocApiBase.cpp29
-rw-r--r--core/LocApiBase.h4
2 files changed, 33 insertions, 0 deletions
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index f44ab45..7b52c82 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -188,6 +188,35 @@ bool LocApiBase::isInSession()
return inSession;
}
+bool LocApiBase::needReport(const UlpLocation& ulpLocation,
+ enum loc_sess_status status,
+ LocPosTechMask techMask)
+{
+ bool reported = false;
+
+ if (LOC_SESS_SUCCESS == status) {
+ // this is a final fix
+ LocPosTechMask mask =
+ LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID;
+ // it is a Satellite fix or a sensor fix
+ reported = (mask & techMask);
+ }
+ else if (LOC_SESS_INTERMEDIATE == status &&
+ LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS) {
+ // this is a intermediate fix and we accept intermediate
+
+ // it is NOT the case that
+ // there is inaccuracy; and
+ // we care about inaccuracy; and
+ // the inaccuracy exceeds our tolerance
+ reported = !((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ACCURACY) &&
+ (ContextBase::mGps_conf.ACCURACY_THRES != 0) &&
+ (ulpLocation.gpsLocation.accuracy > ContextBase::mGps_conf.ACCURACY_THRES));
+ }
+
+ return reported;
+}
+
void LocApiBase::addAdapter(LocAdapterBase* adapter)
{
for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) {
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index ea5e071..e80e273 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -145,6 +145,10 @@ public:
sendMsg(new LocKillMsg(this));
}
+ static bool needReport(const UlpLocation& ulpLocation,
+ enum loc_sess_status status,
+ LocPosTechMask techMask);
+
void addAdapter(LocAdapterBase* adapter);
void removeAdapter(LocAdapterBase* adapter);