diff options
Diffstat (limited to 'gps/core/LocApiBase.cpp')
| -rw-r--r-- | gps/core/LocApiBase.cpp | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp index 8247d0a..5ff7931 100644 --- a/gps/core/LocApiBase.cpp +++ b/gps/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014,2016 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -132,6 +132,7 @@ LocApiBase::LocApiBase(const MsgTask* msgTask, mMask(0), mSupportedMsg(0), mContext(context) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); + memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported)); } LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() @@ -236,13 +237,18 @@ void LocApiBase::reportPosition(UlpLocation &location, LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n " "altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n " "timestamp: %lld\n rawDataSize: %d\n rawData: %p\n " - "Session status: %d\n Technology mask: %u", + "Session status: %d\n Technology mask: %u\n " + "SV used in fix (gps/glo/bds/gal) : (%x/%x/%x/%x)", location.gpsLocation.flags, location.position_source, location.gpsLocation.latitude, location.gpsLocation.longitude, location.gpsLocation.altitude, location.gpsLocation.speed, location.gpsLocation.bearing, location.gpsLocation.accuracy, location.gpsLocation.timestamp, location.rawDataSize, - location.rawData, status, loc_technology_mask); + location.rawData, status, loc_technology_mask, + locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask, + locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask, + locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask, + locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask); // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPosition(location, @@ -253,23 +259,21 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(QcomSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" - " mask: %x/%x/%x\n sv: prn snr elevation azimuth", - svStatus.num_svs, svStatus.ephemeris_mask, - svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, - svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); - for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f", + LOC_LOGV("num sv: %d", svStatus.num_svs); + for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) { + LOC_LOGV(" %03d: %02d %d %f %f %f 0x%02X", i, - svStatus.sv_list[i].prn, - svStatus.sv_list[i].snr, - svStatus.sv_list[i].elevation, - svStatus.sv_list[i].azimuth); + svStatus.gnss_sv_list[i].svid, + svStatus.gnss_sv_list[i].constellation, + svStatus.gnss_sv_list[i].c_n0_dbhz, + svStatus.gnss_sv_list[i].elevation, + svStatus.gnss_sv_list[i].azimuth, + svStatus.gnss_sv_list[i].flags); } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( @@ -358,16 +362,21 @@ void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) mSupportedMsg = supportedMsgList; } +void LocApiBase::saveSupportedFeatureList(uint8_t *featureList) +{ + memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported)); +} + void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData) +void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData) { // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData)); } enum loc_api_adapter_err LocApiBase:: @@ -446,6 +455,10 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: + setNMEATypes (uint32_t typesMask) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: setLPPConfig(uint32_t profile) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -481,12 +494,12 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setExtPowerConfig(int isBatteryCharging) + setAGLONASSProtocol(unsigned long aGlonassProtocol) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setAGLONASSProtocol(unsigned long aGlonassProtocol) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP) + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: getWwanZppFix(GpsLocation& zppLoc) @@ -550,4 +563,14 @@ bool LocApiBase:: gnssConstellationConfig() DEFAULT_IMPL(false) +bool LocApiBase:: + isFeatureSupported(uint8_t featureVal) +{ + uint8_t arrayIndex = featureVal >> 3; + uint8_t bitPos = featureVal & 7; + + if (arrayIndex >= MAX_FEATURE_LENGTH) return false; + return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1); +} + } // namespace loc_core |
