summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2020-12-21 10:12:20 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2020-12-21 10:12:19 -0800
commit93fa7d6ec8ec3afffd9584a11e67e500cd65cb40 (patch)
treee6f725d08e1cc0728f13ea142ae1bee6c47e24e4
parent5c4f7f8c19024886049d63fad25b8ee40bca926d (diff)
parent5b08f5c588593efa335ebf83a99df3be6c7ffdfd (diff)
Merge "Process CP_MTLR in emergency in different conditions"
-rw-r--r--core/ContextBase.cpp2
-rw-r--r--core/ContextBase.h1
-rw-r--r--etc/gps.conf5
-rw-r--r--gnss/GnssAdapter.cpp16
4 files changed, 18 insertions, 6 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index b55b758..e434d47 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -92,6 +92,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
{"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED",
&mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'},
+ {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' },
};
const loc_param_s_type ContextBase::mSap_conf_table[] =
@@ -126,6 +127,7 @@ void ContextBase::readConfig()
mGps_conf.SUPL_VER = 0x10000;
mGps_conf.SUPL_MODE = 0x1;
mGps_conf.SUPL_ES = 0;
+ mGps_conf.CP_MTLR_ES = 0;
mGps_conf.SUPL_HOST[0] = 0;
mGps_conf.SUPL_PORT = 0;
mGps_conf.CAPABILITIES = 0x7;
diff --git a/core/ContextBase.h b/core/ContextBase.h
index 280316c..967f6c3 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -79,6 +79,7 @@ typedef struct loc_gps_cfg_s
uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED;
uint32_t GNSS_DEPLOYMENT;
uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED;
+ uint32_t CP_MTLR_ES;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number
diff --git a/etc/gps.conf b/etc/gps.conf
index 0efc73e..8af4038 100644
--- a/etc/gps.conf
+++ b/etc/gps.conf
@@ -341,3 +341,8 @@ D_LEVEL_MAX_CAPACITY = 300
V_LEVEL_TIME_DEPTH = 200
V_LEVEL_MAX_CAPACITY = 400
+#####################################
+# CP_MTLR_ES
+#####################################
+# CP MTLR ES, 1=enable, 0=disable
+CP_MTLR_ES=0
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index bd36e90..575183b 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -4225,16 +4225,20 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
mNotify(notify),
mData(data) {}
inline virtual void proc() const {
- if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type ||
- GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
+ if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) {
if (mAdapter.getE911State() ||
- ((GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES) &&
- (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type))) {
+ (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES)) {
mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
- }
- else {
+ } else {
mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData);
}
+ } else if (GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
+ if (mAdapter.getE911State() &&
+ (1 == ContextBase::mGps_conf.CP_MTLR_ES)) {
+ mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
+ } else {
+ mAdapter.requestNiNotify(mNotify, mData);
+ }
} else {
mAdapter.requestNiNotify(mNotify, mData);
}