1 /* Copyright (c) 2011-2014,2016-2017,2020 The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of The Linux Foundation, nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29 #define LOG_NDEBUG 0
30 #define LOG_TAG "LocSvc_CtxBase"
31
32 #include <dlfcn.h>
33 #include <unistd.h>
34 #include <ContextBase.h>
35 #include <msg_q.h>
36 #include <loc_target.h>
37 #include <loc_pla.h>
38 #include <loc_log.h>
39
40 namespace loc_core {
41
42 #define SLL_LOC_API_LIB_NAME "libsynergy_loc_api.so"
43 #define LOC_APIV2_0_LIB_NAME "libloc_api_v02.so"
44 #define IS_SS5_HW_ENABLED 1
45
46 loc_gps_cfg_s_type ContextBase::mGps_conf {};
47 loc_sap_cfg_s_type ContextBase::mSap_conf {};
48 bool ContextBase::sIsEngineCapabilitiesKnown = false;
49 uint64_t ContextBase::sSupportedMsgMask = 0;
50 bool ContextBase::sGnssMeasurementSupported = false;
51 uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
52 GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
53
54 const loc_param_s_type ContextBase::mGps_conf_table[] =
55 {
56 {"GPS_LOCK", &mGps_conf.GPS_LOCK, NULL, 'n'},
57 {"SUPL_VER", &mGps_conf.SUPL_VER, NULL, 'n'},
58 {"LPP_PROFILE", &mGps_conf.LPP_PROFILE, NULL, 'n'},
59 {"A_GLONASS_POS_PROTOCOL_SELECT", &mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
60 {"LPPE_CP_TECHNOLOGY", &mGps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'},
61 {"LPPE_UP_TECHNOLOGY", &mGps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'},
62 {"AGPS_CERT_WRITABLE_MASK", &mGps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
63 {"SUPL_MODE", &mGps_conf.SUPL_MODE, NULL, 'n'},
64 {"SUPL_ES", &mGps_conf.SUPL_ES, NULL, 'n'},
65 {"INTERMEDIATE_POS", &mGps_conf.INTERMEDIATE_POS, NULL, 'n'},
66 {"ACCURACY_THRES", &mGps_conf.ACCURACY_THRES, NULL, 'n'},
67 {"NMEA_PROVIDER", &mGps_conf.NMEA_PROVIDER, NULL, 'n'},
68 {"NMEA_REPORT_RATE", &mGps_conf.NMEA_REPORT_RATE, NULL, 's'},
69 {"CAPABILITIES", &mGps_conf.CAPABILITIES, NULL, 'n'},
70 {"XTRA_VERSION_CHECK", &mGps_conf.XTRA_VERSION_CHECK, NULL, 'n'},
71 {"XTRA_SERVER_1", &mGps_conf.XTRA_SERVER_1, NULL, 's'},
72 {"XTRA_SERVER_2", &mGps_conf.XTRA_SERVER_2, NULL, 's'},
73 {"XTRA_SERVER_3", &mGps_conf.XTRA_SERVER_3, NULL, 's'},
74 {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL",
75 &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
76 {"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
77 {"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
78 {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'},
79 {"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'},
80 {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' },
81 {"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' },
82 {"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' },
83 {"CONSTRAINED_TIME_UNCERTAINTY_ENABLED",
84 &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'},
85 {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD",
86 &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'},
87 {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET",
88 &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'},
89 {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED",
90 &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'},
91 {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' },
92 {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' },
93 {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
94 {"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED",
95 &mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'},
96 {"NI_SUPL_DENY_ON_NFW_LOCKED", &mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED, NULL, 'n'},
97 };
98
99 const loc_param_s_type ContextBase::mSap_conf_table[] =
100 {
101 {"GYRO_BIAS_RANDOM_WALK", &mSap_conf.GYRO_BIAS_RANDOM_WALK, &mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
102 {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
103 {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
104 {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
105 {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
106 {"SENSOR_ACCEL_BATCHES_PER_SEC", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
107 {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
108 {"SENSOR_GYRO_BATCHES_PER_SEC", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
109 {"SENSOR_GYRO_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
110 {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
111 {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
112 {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
113 {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
114 {"SENSOR_CONTROL_MODE", &mSap_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
115 {"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}
116 };
117
readConfig()118 void ContextBase::readConfig()
119 {
120 static bool confReadDone = false;
121 if (!confReadDone) {
122 confReadDone = true;
123 /*Defaults for gps.conf*/
124 mGps_conf.INTERMEDIATE_POS = 0;
125 mGps_conf.ACCURACY_THRES = 0;
126 mGps_conf.NMEA_PROVIDER = 0;
127 mGps_conf.GPS_LOCK = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
128 mGps_conf.SUPL_VER = 0x10000;
129 mGps_conf.SUPL_MODE = 0x1;
130 mGps_conf.SUPL_ES = 0;
131 mGps_conf.CP_MTLR_ES = 0;
132 mGps_conf.SUPL_HOST[0] = 0;
133 mGps_conf.SUPL_PORT = 0;
134 mGps_conf.CAPABILITIES = 0x7;
135 /* LTE Positioning Profile configuration is disable by default*/
136 mGps_conf.LPP_PROFILE = 0;
137 /*By default no positioning protocol is selected on A-GLONASS system*/
138 mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
139 /*XTRA version check is disabled by default*/
140 mGps_conf.XTRA_VERSION_CHECK=0;
141 /*Use emergency PDN by default*/
142 mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
143 /* By default no LPPe CP technology is enabled*/
144 mGps_conf.LPPE_CP_TECHNOLOGY = 0;
145 /* By default no LPPe UP technology is enabled*/
146 mGps_conf.LPPE_UP_TECHNOLOGY = 0;
147 /* By default we use unknown modem type*/
148 mGps_conf.MODEM_TYPE = 2;
149
150 /*Defaults for sap.conf*/
151 mSap_conf.GYRO_BIAS_RANDOM_WALK = 0;
152 mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
153 mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
154 mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
155 mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
156 mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
157 mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
158 mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
159 mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
160 mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
161 mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
162 /* Values MUST be set by OEMs in configuration for sensor-assisted
163 navigation to work. There are NO default values */
164 mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
165 mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
166 mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
167 mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
168 mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
169 mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
170 mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
171 mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
172 mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
173
174 /* None of the 10 slots for agps certificates are writable by default */
175 mGps_conf.AGPS_CERT_WRITABLE_MASK = 0;
176
177 /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
178 mGps_conf.AGPS_CONFIG_INJECT = 1;
179
180 /* default configuration value of constrained time uncertainty mode:
181 feature disabled, time uncertainty threshold defined by modem,
182 and unlimited power budget */
183 #ifdef FEATURE_AUTOMOTIVE
184 mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 1;
185 #else
186 mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0;
187 #endif
188 mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0;
189 mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0;
190
191 /* default configuration value of position assisted clock estimator mode */
192 mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0;
193 /* default configuration QTI GNSS H/W */
194 mGps_conf.GNSS_DEPLOYMENT = 0;
195 mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0;
196 /* default configuration for NI_SUPL_DENY_ON_NFW_LOCKED */
197 mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED = 1;
198
199 UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
200 UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
201
202 if (strncmp(mGps_conf.NMEA_REPORT_RATE, "1HZ", sizeof(mGps_conf.NMEA_REPORT_RATE)) == 0) {
203 /* NMEA reporting is configured at 1Hz*/
204 sNmeaReportRate = GNSS_NMEA_REPORT_RATE_1HZ;
205 } else {
206 sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
207 }
208 LOC_LOGI("%s] GNSS Deployment: %s", __FUNCTION__,
209 ((mGps_conf.GNSS_DEPLOYMENT == 1) ? "SS5" :
210 ((mGps_conf.GNSS_DEPLOYMENT == 2) ? "QFUSION" : "QGNSS")));
211
212 switch (getTargetGnssType(loc_get_target())) {
213 case GNSS_GSS:
214 case GNSS_AUTO:
215 // For APQ targets, MSA/MSB capabilities should be reset
216 mGps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
217 break;
218 default:
219 break;
220 }
221 }
222 }
223
getCarrierCapabilities()224 uint32_t ContextBase::getCarrierCapabilities() {
225 #define carrierMSA (uint32_t)0x2
226 #define carrierMSB (uint32_t)0x1
227 #define gpsConfMSA (uint32_t)0x4
228 #define gpsConfMSB (uint32_t)0x2
229 uint32_t capabilities = mGps_conf.CAPABILITIES;
230 if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
231 capabilities &= ~gpsConfMSA;
232 }
233 if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
234 capabilities &= ~gpsConfMSB;
235 }
236
237 LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
238 mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities);
239 return capabilities;
240 }
241
getLBSProxy(const char * libName)242 LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
243 {
244 LBSProxyBase* proxy = NULL;
245 LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName);
246 void* lib = dlopen(libName, RTLD_NOW);
247
248 if ((void*)NULL != lib) {
249 getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy");
250 if (NULL != getter) {
251 proxy = (*getter)();
252 }
253 }
254 else
255 {
256 LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName);
257 }
258 if (NULL == proxy) {
259 proxy = new LBSProxyBase();
260 }
261 LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__);
262 return proxy;
263 }
264
createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)265 LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
266 {
267 LocApiBase* locApi = NULL;
268 const char* libname = LOC_APIV2_0_LIB_NAME;
269
270 // Check the target
271 if (TARGET_NO_GNSS != loc_get_target()){
272
273 if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) {
274 void *handle = NULL;
275
276 if (IS_SS5_HW_ENABLED == mGps_conf.GNSS_DEPLOYMENT) {
277 libname = SLL_LOC_API_LIB_NAME;
278 }
279
280 if ((handle = dlopen(libname, RTLD_NOW)) != NULL) {
281 LOC_LOGD("%s:%d]: %s is present", __func__, __LINE__, libname);
282 getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
283 if (getter != NULL) {
284 LOC_LOGD("%s:%d]: getter is not NULL of %s", __func__,
285 __LINE__, libname);
286 locApi = (*getter)(exMask, this);
287 }
288 }
289 // only RPC is the option now
290 else {
291 LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
292 __func__, __LINE__);
293 handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
294 if (NULL != handle) {
295 getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
296 if (NULL != getter) {
297 LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
298 __LINE__);
299 locApi = (*getter)(exMask, this);
300 }
301 }
302 }
303 }
304 }
305
306 // locApi could still be NULL at this time
307 // we would then create a dummy one
308 if (NULL == locApi) {
309 locApi = new LocApiBase(exMask, this);
310 }
311
312 return locApi;
313 }
314
ContextBase(const MsgTask * msgTask,LOC_API_ADAPTER_EVENT_MASK_T exMask,const char * libName)315 ContextBase::ContextBase(const MsgTask* msgTask,
316 LOC_API_ADAPTER_EVENT_MASK_T exMask,
317 const char* libName) :
318 mLBSProxy(getLBSProxy(libName)),
319 mMsgTask(msgTask),
320 mLocApi(createLocApi(exMask)),
321 mLocApiProxy(mLocApi->getLocApiProxy())
322 {
323 }
324
setEngineCapabilities(uint64_t supportedMsgMask,uint8_t * featureList,bool gnssMeasurementSupported)325 void ContextBase::setEngineCapabilities(uint64_t supportedMsgMask,
326 uint8_t *featureList, bool gnssMeasurementSupported) {
327
328 if (ContextBase::sIsEngineCapabilitiesKnown == false) {
329 ContextBase::sSupportedMsgMask = supportedMsgMask;
330 ContextBase::sGnssMeasurementSupported = gnssMeasurementSupported;
331 if (featureList != NULL) {
332 memcpy((void *)ContextBase::sFeaturesSupported,
333 (void *)featureList, sizeof(ContextBase::sFeaturesSupported));
334 }
335
336 /* */
337 if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION)) {
338 static uint8_t isSapModeKnown = 0;
339
340 if (!isSapModeKnown) {
341 /* Check if SAP is PREMIUM_ENV_AIDING in izat.conf */
342 char conf_feature_sap[LOC_MAX_PARAM_STRING];
343 loc_param_s_type izat_conf_feature_table[] =
344 {
345 { "SAP", &conf_feature_sap, &isSapModeKnown, 's' }
346 };
347 UTIL_READ_CONF(LOC_PATH_IZAT_CONF, izat_conf_feature_table);
348
349 /* Disable this feature if SAP is not PREMIUM_ENV_AIDING in izat.conf */
350 if (strcmp(conf_feature_sap, "PREMIUM_ENV_AIDING") != 0) {
351 uint8_t arrayIndex = LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION >> 3;
352 uint8_t bitPos = LOC_SUPPORTED_FEATURE_MEASUREMENTS_CORRECTION & 7;
353
354 if (arrayIndex < MAX_FEATURE_LENGTH) {
355 /* To disable the feature we need to reset the bit on the "bitPos"
356 position, so shift a "1" to the left by "bitPos" */
357 ContextBase::sFeaturesSupported[arrayIndex] &= ~(1 << bitPos);
358 }
359 }
360 }
361 }
362 ContextBase::sIsEngineCapabilitiesKnown = true;
363 }
364 }
365
366
isFeatureSupported(uint8_t featureVal)367 bool ContextBase::isFeatureSupported(uint8_t featureVal)
368 {
369 uint8_t arrayIndex = featureVal >> 3;
370 uint8_t bitPos = featureVal & 7;
371
372 if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
373 return ((ContextBase::sFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
374 }
375
gnssConstellationConfig()376 bool ContextBase::gnssConstellationConfig() {
377 return sGnssMeasurementSupported;
378 }
379
380 }
381