diff options
Diffstat (limited to 'location')
-rw-r--r-- | location/LocationAPI.cpp | 1 | ||||
-rw-r--r-- | location/LocationAPIClientBase.h | 2 | ||||
-rw-r--r-- | location/LocationDataTypes.h | 58 |
3 files changed, 60 insertions, 1 deletions
diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index a43178d..4348c27 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -85,6 +85,7 @@ static bool isGnssClient(LocationCallbacks& locationCallbacks) return (locationCallbacks.gnssNiCb != nullptr || locationCallbacks.trackingCb != nullptr || locationCallbacks.gnssLocationInfoCb != nullptr || + locationCallbacks.engineLocationsInfoCb != nullptr || locationCallbacks.gnssMeasurementsCb != nullptr); } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index fddae60..098000c 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -488,6 +488,7 @@ private: for (size_t i = 0; i < count; i++) { ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); } + LOC_LOGD("%s:]Returned geofence-id: %d in add geofence", __FUNCTION__, *ids); mAPI.onAddGeofencesCb(count, errors, ids); free(ids); } @@ -505,6 +506,7 @@ private: for (size_t i = 0; i < count; i++) { ids[i] = mRemovedGeofenceBiDict->getId(sessions[i]); } + LOC_LOGD("%s:]Returned geofence-id: %d in remove geofence", __FUNCTION__, *ids); mAPI.onRemoveGeofencesCb(count, errors, ids); free(ids); delete(mRemovedGeofenceBiDict); diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 49822fa..504b5cc 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -175,6 +175,8 @@ typedef enum { GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT = (1<<24), // number of SV used in position GNSS_LOCATION_INFO_CALIBRATION_CONFIDENCE_BIT = (1<<25), // valid sensor cal confidence GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT = (1<<26), // valid sensor cal status + GNSS_LOCATION_INFO_OUTPUT_ENG_TYPE_BIT = (1<<27), // valid output engine type + GNSS_LOCATION_INFO_OUTPUT_ENG_MASK_BIT = (1<<28), // valid output engine mask } GnssLocationInfoFlagBits; typedef enum { @@ -646,6 +648,13 @@ typedef enum { GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 20 /**< Maximum number of signal types */ } Gnss_LocSignalEnumType; +typedef uint32_t PositioningEngineMask; +typedef enum { + STANDARD_POSITIONING_ENGINE = (1 << 0), + DEAD_RECKONING_ENGINE = (1 << 1), + PRECISE_POSITIONING_ENGINE = (1 << 2) +} PositioningEngineBits; + typedef uint64_t GnssDataMask; typedef enum { // Jammer Indicator is available @@ -731,15 +740,35 @@ typedef struct { LocationSpoofMask spoofMask; } Location; +typedef enum { + LOC_REQ_ENGINE_FUSED_BIT = (1<<0), + LOC_REQ_ENGINE_SPE_BIT = (1<<1), + LOC_REQ_ENGINE_PPE_BIT = (1<<2), +} LocReqEngineTypeMask; + +typedef enum { + LOC_OUTPUT_ENGINE_FUSED = 0, + /** This is the GNSS fix from modem */ + LOC_OUTPUT_ENGINE_SPE = 1, + /** This is the GNSS fix with correction PPP/RTK correction */ + LOC_OUTPUT_ENGINE_PPE = 2, + LOC_OUTPUT_ENGINE_COUNT, +} LocOutputEngineType; + struct LocationOptions { uint32_t size; // set to sizeof(LocationOptions) uint32_t minInterval; // in milliseconds uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ // gnssMeasurementsCallback may not be called GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted + // behavior when this field is 0: + // if engine hub is running, this will be fused fix, + // if engine hub is not running, this will be SPE fix + LocReqEngineTypeMask locReqEngTypeMask; inline LocationOptions() : - size(0), minInterval(0), minDistance(0), mode(GNSS_SUPL_MODE_STANDALONE) {} + size(0), minInterval(0), minDistance(0), mode(GNSS_SUPL_MODE_STANDALONE), + locReqEngTypeMask((LocReqEngineTypeMask)0) {} }; typedef enum { @@ -764,9 +793,11 @@ struct TrackingOptions : LocationOptions { inline TrackingOptions(const LocationOptions& options) : LocationOptions(options), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} inline void setLocationOptions(const LocationOptions& options) { + size = sizeof(TrackingOptions); minInterval = options.minInterval; minDistance = options.minDistance; mode = options.mode; + locReqEngTypeMask = options.locReqEngTypeMask; } inline LocationOptions getLocationOptions() { LocationOptions locOption; @@ -774,6 +805,7 @@ struct TrackingOptions : LocationOptions { locOption.minDistance = minDistance; locOption.minInterval = minInterval; locOption.mode = mode; + locOption.locReqEngTypeMask = locReqEngTypeMask; return locOption; } }; @@ -997,6 +1029,15 @@ typedef struct { uint8_t calibrationConfidence; // Sensor calibration confidence percent, // in range of [0, 100] DrCalibrationStatusMask calibrationStatus; // Sensor calibration status + // location engine type. When the fix. when the type is set to + // LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated + // reports from all engines running on the system (e.g.: + // DR/SPE/PPE). To check which location engine contributes to + // the fused output, check for locOutputEngMask. + LocOutputEngineType locOutputEngType; + // when loc output eng type is set to fused, this field + // indicates the set of engines contribute to the fix. + PositioningEngineMask locOutputEngMask; } GnssLocationInfoNotification; typedef struct { @@ -1317,6 +1358,20 @@ typedef std::function<void( GnssLocationInfoNotification gnssLocationInfoNotification )> gnssLocationInfoCallback; +/* Gives default combined location information from all engines and + location information individually from selected engines. + This callback is only used when there are multiple engines + running in the system. + + optional can be NULL + + engineLocationsInfoCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function<void( + uint32_t count, + GnssLocationInfoNotification* engineLocationInfoNotification +)> engineLocationsInfoCallback; + /* Used for addGeofences API, optional can be NULL geofenceBreachCallback is called when any number of geofences have a state change */ typedef std::function<void( @@ -1403,6 +1458,7 @@ typedef struct { gnssMeasurementsCallback gnssMeasurementsCb; // optional batchingStatusCallback batchingStatusCb; // optional locationSystemInfoCallback locationSystemInfoCb; // optional + engineLocationsInfoCallback engineLocationsInfoCb; // optional } LocationCallbacks; #endif /* LOCATIONDATATYPES_H */ |