Populate some more fields for end client.

These are the fields populated:

North, East, Up velocity and their uncertainties
North and East standard deviation
Gps Time, Leap Sec and time uncertainty
Gps Measurement usage info

CRs-Fixed: 2249350

Change-Id: I8936b1c47be25fdc792322592f8ea5466a3fa6fd
This commit is contained in:
Bhavna Sharma 2018-05-25 14:34:08 -07:00 committed by Gerrit - the friendly Code Review server
parent 7574a7d4fd
commit 6c80f04dba
3 changed files with 140 additions and 9 deletions

View file

@ -320,6 +320,38 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out,
out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT; out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT;
out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth; out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth;
} }
if (GPS_LOCATION_EXTENDED_HAS_NORTH_STD_DEV & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT;
out.northVelocityStdDeviation = locationExtended.northStdDeviation;
}
if (GPS_LOCATION_EXTENDED_HAS_EAST_STD_DEV & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_EAST_STD_DEV_BIT;
out.eastVelocityStdDeviation = locationExtended.eastStdDeviation;
}
if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_BIT;
out.northVelocity = locationExtended.northVelocity;
}
if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT;
out.northVelocityStdDeviation = locationExtended.northVelocityStdDeviation;
}
if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_EAST_VEL_BIT;
out.eastVelocity = locationExtended.eastVelocity;
}
if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT;
out.eastVelocityStdDeviation = locationExtended.eastVelocityStdDeviation;
}
if (GPS_LOCATION_EXTENDED_HAS_UP_VEL & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_UP_VEL_BIT;
out.upVelocity = locationExtended.upVelocity;
}
if (GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_UP_VEL_UNC_BIT;
out.upVelocityStdDeviation = locationExtended.upVelocityStdDeviation;
}
if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT; out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT;
out.svUsedInPosition.gpsSvUsedIdsMask = out.svUsedInPosition.gpsSvUsedIdsMask =
@ -332,6 +364,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out,
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask;
out.svUsedInPosition.qzssSvUsedIdsMask = out.svUsedInPosition.qzssSvUsedIdsMask =
locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask;
out.numOfMeasReceived = locationExtended.numOfMeasReceived;
for (int idx =0; idx < locationExtended.numOfMeasReceived; idx++) {
out.measUsageInfo[idx].gnssSignalType =
locationExtended.measUsageInfo[idx].gnssSignalType;
out.measUsageInfo[idx].gnssSvId =
locationExtended.measUsageInfo[idx].gnssSvId;
out.measUsageInfo[idx].gnssConstellation =
locationExtended.measUsageInfo[idx].gnssConstellation;
}
} }
if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) { if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT; out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT;
@ -367,6 +409,19 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out,
out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate; out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate;
out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch; out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch;
} }
// Validity of this structure is established from the timeSrc of the GnssSystemTime structure.
out.gnssSystemTime = locationExtended.gnssSystemTime;
if (GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_LEAP_SECONDS_BIT;
out.leapSeconds = locationExtended.leapSeconds;
}
if (GPS_LOCATION_EXTENDED_HAS_TIME_UNC & locationExtended.flags) {
out.flags |= GNSS_LOCATION_INFO_TIME_UNC_BIT;
out.timeUncMs = locationExtended.timeUncMs;
}
} }
inline uint32_t inline uint32_t

View file

@ -137,8 +137,17 @@ typedef enum {
GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask
GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource
GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data
GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<13),// valid gdop, tdop
GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT = (1<<14),// valid North standard deviation
GNSS_LOCATION_INFO_EAST_STD_DEV_BIT = (1<<15),// valid East standard deviation
GNSS_LOCATION_INFO_NORTH_VEL_BIT = (1<<16),// valid North Velocity
GNSS_LOCATION_INFO_EAST_VEL_BIT = (1<<17),// valid East Velocity
GNSS_LOCATION_INFO_UP_VEL_BIT = (1<<18),// valid Up Velocity
GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT = (1<<19),// valid North Velocity Uncertainty
GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT = (1<<20),// valid East Velocity Uncertainty
GNSS_LOCATION_INFO_UP_VEL_UNC_BIT = (1<<21),// valid Up Velocity Uncertainty
GNSS_LOCATION_INFO_LEAP_SECONDS_BIT = (1<<22),// valid leap seconds
GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23) // valid time uncertainty
} GnssLocationInfoFlagBits; } GnssLocationInfoFlagBits;
typedef enum { typedef enum {
@ -452,6 +461,43 @@ typedef enum {
GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4),
} GnssAidingDataSvTypeBits; } GnssAidingDataSvTypeBits;
/** GNSS Signal Type and RF Band */
typedef uint32_t GnssSignalTypeMask;
typedef enum {
/** GPS L1CA Signal */
GNSS_SIGNAL_GPS_L1CA = (1<<0),
/** GPS L1C Signal */
GNSS_SIGNAL_GPS_L1C = (1<<1),
/** GPS L2 RF Band */
GNSS_SIGNAL_GPS_L2 = (1<<2),
/** GPS L5 RF Band */
GNSS_SIGNAL_GPS_L5 = (1<<3),
/** GLONASS G1 (L1OF) RF Band */
GNSS_SIGNAL_GLONASS_G1 = (1<<4),
/** GLONASS G2 (L2OF) RF Band */
GNSS_SIGNAL_GLONASS_G2 = (1<<5),
/** GALILEO E1 RF Band */
GNSS_SIGNAL_GALILEO_E1 = (1<<6),
/** GALILEO E5A RF Band */
GNSS_SIGNAL_GALILEO_E5A = (1<<7),
/** GALILEO E5B RF Band */
GNSS_SIGNAL_GALILIEO_E5B = (1<<8),
/** BEIDOU B1 RF Band */
GNSS_SIGNAL_BEIDOU_B1 = (1<<9),
/** BEIDOU B2 RF Band */
GNSS_SIGNAL_BEIDOU_B2 = (1<<10),
/** QZSS L1CA RF Band */
GNSS_SIGNAL_QZSS_L1CA = (1<<11),
/** QZSS L1S RF Band */
GNSS_SIGNAL_QZSS_L1S = (1<<12),
/** QZSS L2 RF Band */
GNSS_SIGNAL_QZSS_L2 = (1<<13),
/** QZSS L5 RF Band */
GNSS_SIGNAL_QZSS_L5 = (1<<14),
/** SBAS L1 RF Band */
GNSS_SIGNAL_SBAS_L1 = (1<<15)
} GnssSignalTypeBits;
typedef enum typedef enum
{ {
GNSS_LOC_SV_SYSTEM_GPS = 1, GNSS_LOC_SV_SYSTEM_GPS = 1,
@ -587,6 +633,21 @@ typedef struct {
uint64_t qzssSvUsedIdsMask; uint64_t qzssSvUsedIdsMask;
} GnssLocationSvUsedInPosition; } GnssLocationSvUsedInPosition;
typedef struct {
/** GnssSignalType mask */
GnssSignalTypeMask gnssSignalType;
/** Specifies GNSS Constellation Type */
Gnss_LocSvSystemEnumType gnssConstellation;
/** GNSS SV ID.
For GPS: 1 to 32
For GLONASS: 65 to 96. When slot-number to SV ID mapping is unknown, set as 255.
For SBAS: 120 to 151
For QZSS-L1CA:193 to 197
For BDS: 201 to 237
For GAL: 301 to 336 */
uint16_t gnssSvId;
} GnssMeasUsageInfo;
/** @struct /** @struct
Body Frame parameters Body Frame parameters
*/ */
@ -702,9 +763,11 @@ typedef struct {
float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis
float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis
float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth
float northStdDeviation; // North standard deviation Unit: Meters
float eastStdDeviation; // East standard deviation. Unit: Meters
float northVelocity; // North Velocity.Unit: Meters/sec float northVelocity; // North Velocity.Unit: Meters/sec
float eastVelocity; // East Velocity float eastVelocity; // East Velocity Unit Meters/sec
float upVelocity; float upVelocity; // Up Velocity. Unit Meters/sec
float northVelocityStdDeviation; float northVelocityStdDeviation;
float eastVelocityStdDeviation; float eastVelocityStdDeviation;
float upVelocityStdDeviation; float upVelocityStdDeviation;
@ -714,6 +777,10 @@ typedef struct {
GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and
// pitch set with validity // pitch set with validity
GnssSystemTime gnssSystemTime; // GNSS System Time GnssSystemTime gnssSystemTime; // GNSS System Time
uint8_t numOfMeasReceived; // Number of measurements received for use in fix.
GnssMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; // GNSS Measurement Usage info
uint8_t leapSeconds; // leap second
float timeUncMs; // Time uncertainty in milliseconds
Location location; Location location;
} GnssLocationInfoNotification; } GnssLocationInfoNotification;

View file

@ -268,7 +268,7 @@ typedef enum loc_position_mode_type {
#define GPS_DEFAULT_FIX_INTERVAL_MS 1000 #define GPS_DEFAULT_FIX_INTERVAL_MS 1000
/** Flags to indicate which values are valid in a GpsLocationExtended. */ /** Flags to indicate which values are valid in a GpsLocationExtended. */
typedef uint32_t GpsLocationExtendedFlags; typedef uint64_t GpsLocationExtendedFlags;
/** GpsLocationExtended has valid pdop, hdop, vdop. */ /** GpsLocationExtended has valid pdop, hdop, vdop. */
#define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001
/** GpsLocationExtended has valid altitude mean sea level. */ /** GpsLocationExtended has valid altitude mean sea level. */
@ -323,14 +323,19 @@ typedef uint32_t GpsLocationExtendedFlags;
#define GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC 0x2000000 #define GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC 0x2000000
/** GpsLocationExtended has up Velocity Uncertainty */ /** GpsLocationExtended has up Velocity Uncertainty */
#define GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC 0x4000000 #define GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC 0x4000000
/** GpsLocationExtended has up Clock Bias */ /** GpsLocationExtended has Clock Bias */
#define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS 0x8000000 #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS 0x8000000
/** GpsLocationExtended has up Clock Bias std deviation*/ /** GpsLocationExtended has Clock Bias std deviation*/
#define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS_STD_DEV 0x10000000 #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS_STD_DEV 0x10000000
/** GpsLocationExtended has up Clock drift*/ /** GpsLocationExtended has Clock drift*/
#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000 #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000
/** GpsLocationExtended has up Clock drift std deviation**/ /** GpsLocationExtended has Clock drift std deviation**/
#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000
/** GpsLocationExtended has leap seconds **/
#define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000
/** GpsLocationExtended has time uncertainty **/
#define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000
typedef uint32_t LocNavSolutionMask; typedef uint32_t LocNavSolutionMask;
/* Bitmask to specify whether SBAS ionospheric correction is used */ /* Bitmask to specify whether SBAS ionospheric correction is used */
@ -660,6 +665,10 @@ typedef struct {
uint8_t numOfMeasReceived; uint8_t numOfMeasReceived;
/** Measurement Usage Information */ /** Measurement Usage Information */
GpsMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; GpsMeasUsageInfo measUsageInfo[GNSS_SV_MAX];
/** Leap Seconds */
uint8_t leapSeconds;
/** Time uncertainty in milliseconds */
float timeUncMs;
} GpsLocationExtended; } GpsLocationExtended;
enum loc_sess_status { enum loc_sess_status {