summaryrefslogtreecommitdiff
path: root/utils/gps_extended_c.h
diff options
context:
space:
mode:
authorWei Chen <weic@codeaurora.org>2018-12-04 15:55:00 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-01-30 14:29:30 -0800
commit8e04d01cd2e35bfea1dc7d1f5f689e7780a90f1f (patch)
tree07df640611c88c80fabb5818be1d629287c5c13d /utils/gps_extended_c.h
parent9d6d95d09650ea9ada4771f00f1991b7a5f2cc91 (diff)
downloadgps-8e04d01cd2e35bfea1dc7d1f5f689e7780a90f1f.tar.gz
GPS SV meas: new structure to support 10Hz
(1) revise struct of GnssSvMeasurementSet so it can be used to send only valid SV measurement via IPC (2) remove reference to COMPASS system, as COMPASS named is replaced by BEIDOU system (3) correct typo in GNSS_GLOS_MSEC_VALID to GNSS_GLO_MSEC_VALID CRs-fixed: 2337832 Change-Id: I325346fa414e3a94422cb8ab4cc5b77d6efaf485
Diffstat (limited to 'utils/gps_extended_c.h')
-rw-r--r--utils/gps_extended_c.h175
1 files changed, 58 insertions, 117 deletions
diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h
index 8ddf488..22b2dd0 100644
--- a/utils/gps_extended_c.h
+++ b/utils/gps_extended_c.h
@@ -410,6 +410,8 @@ typedef uint32_t LocPosDataMask;
/** GPS PRN Range */
#define GPS_SV_PRN_MIN 1
#define GPS_SV_PRN_MAX 32
+#define SBAS_SV_PRN_MIN 33
+#define SBAS_SV_PRN_MAX 64
#define GLO_SV_PRN_MIN 65
#define GLO_SV_PRN_MAX 96
#define QZSS_SV_PRN_MIN 193
@@ -838,8 +840,8 @@ enum loc_api_adapter_event_index {
LOC_API_ADAPTER_BATCH_FULL, // Batching on full
LOC_API_ADAPTER_BATCHED_POSITION_REPORT, // Batching on fix
LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT, //
- LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT, //GNSS Measurement Report
- LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT, //GNSS SV Polynomial Report
+ LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT, // GNSS Measurement Report
+ LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT, // GNSS SV Polynomial Report
LOC_API_ADAPTER_GDT_UPLOAD_BEGIN_REQ, // GDT upload start request
LOC_API_ADAPTER_GDT_UPLOAD_END_REQ, // GDT upload end request
LOC_API_ADAPTER_GNSS_MEASUREMENT, // GNSS Measurement report
@@ -853,6 +855,7 @@ enum loc_api_adapter_event_index {
LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ, // BS observation data request
LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT, // GNSS SV Ephemeris Report
LOC_API_ADAPTER_LOC_SYSTEM_INFO, // Location system info event
+ LOC_API_ADAPTER_GNSS_NHZ_MEASUREMENT_REPORT, // GNSS SV nHz measurement report
LOC_API_ADAPTER_EVENT_MAX
};
@@ -893,6 +896,7 @@ enum loc_api_adapter_event_index {
#define LOC_API_ADAPTER_BIT_BS_OBS_DATA_SERVICE_REQ (1ULL<<LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ)
#define LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT (1ULL<<LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT)
#define LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO (1ULL<<LOC_API_ADAPTER_LOC_SYSTEM_INFO)
+#define LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT (1ULL<<LOC_API_ADAPTER_GNSS_NHZ_MEASUREMENT_REPORT)
typedef uint64_t LOC_API_ADAPTER_EVENT_MASK_T;
@@ -925,7 +929,8 @@ typedef uint32_t LOC_GPS_LOCK_MASK;
#define GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE 3
#define GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE 9
#define GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE 4
-#define GNSS_LOC_SV_MEAS_LIST_MAX_SIZE 16
+/** Max number of GNSS SV measurement */
+#define GNSS_LOC_SV_MEAS_LIST_MAX_SIZE 128
enum ulp_gnss_sv_measurement_valid_flags{
@@ -1057,69 +1062,9 @@ typedef struct
*/
}Gnss_InterSystemBiasStructType;
-
-typedef struct
-{
- size_t size;
- uint16_t systemWeek;
- /**< System week number for GPS, BDS and GAL satellite systems. \n
- Set to 65535 when invalid or not available. \n
- Not valid for GLONASS system. \n
- */
-
- uint32_t systemMsec;
- /**< System time msec. Time of Week for GPS, BDS, GAL and
- Time of Day for GLONASS.
- - Units: msec \n
- */
- float systemClkTimeBias;
- /**< System clock time bias \n
- - Units: msec \n
- System time = systemMsec - systemClkTimeBias \n
- */
- float systemClkTimeUncMs;
- /**< Single sided maximum time bias uncertainty \n
- - Units: msec \n
- */
-}Gnss_LocSystemTimeStructType;
-
-typedef struct {
-
- size_t size;
- uint8_t gloFourYear;
- /**< GLONASS four year number from 1996. Refer to GLONASS ICD.\n
- Applicable only for GLONASS and shall be ignored for other constellations. \n
- If unknown shall be set to 255
- */
-
- uint16_t gloDays;
- /**< GLONASS day number in four years. Refer to GLONASS ICD.
- Applicable only for GLONASS and shall be ignored for other constellations. \n
- If unknown shall be set to 65535
- */
-
- uint32_t gloMsec;
- /**< GLONASS time of day in msec. Refer to GLONASS ICD.
- - Units: msec \n
- */
-
- float gloClkTimeBias;
- /**< System clock time bias (sub-millisecond) \n
- - Units: msec \n
- System time = systemMsec - systemClkTimeBias \n
- */
-
- float gloClkTimeUncMs;
- /**< Single sided maximum time bias uncertainty \n
- - Units: msec \n
- */
-}Gnss_LocGloTimeStructType; /* Type */
-
typedef struct {
size_t size;
- uint32_t refFCount;
- /**< Receiver frame counter value at reference tick */
uint8_t systemRtc_valid;
/**< Validity indicator for System RTC */
@@ -1129,13 +1074,8 @@ typedef struct {
- Units: msec \n
*/
- uint32_t sourceOfTime;
- /**< Source of time information */
-
}Gnss_LocGnssTimeExtStructType;
-
-
typedef enum
{
GNSS_LOC_MEAS_STATUS_NULL = 0x00000000,
@@ -1231,6 +1171,9 @@ typedef enum
typedef struct
{
size_t size;
+ Gnss_LocSvSystemEnumType gnssSystem;
+ // 0 signal type mask indicates invalid value
+ GnssSignalTypeMask gnssSignalTypeMask;
uint16_t gnssSvId;
/**< GNSS SV ID.
\begin{itemize1}
@@ -1367,71 +1310,69 @@ typedef struct
} Gnss_SVMeasurementStructType;
-/**< Maximum number of satellites in measurement block for given system. */
-
-typedef struct
-{
- size_t size;
- Gnss_LocSvSystemEnumType system;
- /**< Specifies the Satellite System Type
- */
- bool isSystemTimeValid;
- /**< Indicates whether System Time is Valid:\n
- - 0x01 (TRUE) -- System Time is valid \n
- - 0x00 (FALSE) -- System Time is not valid
- */
- Gnss_LocSystemTimeStructType systemTime;
- /**< System Time Information \n
- */
- bool isGloTime_valid;
- Gnss_LocGloTimeStructType gloTime;
-
- bool isSystemTimeExt_valid;
- Gnss_LocGnssTimeExtStructType systemTimeExt;
-
- uint8_t numSvs;
- /* Number of SVs in this report block */
-
- Gnss_SVMeasurementStructType svMeasurement[GNSS_LOC_SV_MEAS_LIST_MAX_SIZE];
- /**< Satellite measurement Information \n
- */
-} Gnss_ClockMeasurementStructType;
+typedef uint64_t GpsSvMeasHeaderFlags;
+#define GNSS_SV_MEAS_HEADER_HAS_LEAP_SECOND 0x00000001
+#define GNSS_SV_MEAS_HEADER_HAS_CLOCK_FREQ 0x00000002
+#define GNSS_SV_MEAS_HEADER_HAS_AP_TIMESTAMP 0x00000004
+#define GNSS_SV_MEAS_HEADER_HAS_GPS_GLO_INTER_SYSTEM_BIAS 0x00000008
+#define GNSS_SV_MEAS_HEADER_HAS_GPS_BDS_INTER_SYSTEM_BIAS 0x00000010
+#define GNSS_SV_MEAS_HEADER_HAS_GPS_GAL_INTER_SYSTEM_BIAS 0x00000020
+#define GNSS_SV_MEAS_HEADER_HAS_BDS_GLO_INTER_SYSTEM_BIAS 0x00000040
+#define GNSS_SV_MEAS_HEADER_HAS_GAL_GLO_INTER_SYSTEM_BIAS 0x00000080
+#define GNSS_SV_MEAS_HEADER_HAS_GAL_BDS_INTER_SYSTEM_BIAS 0x00000100
+#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME 0x00000200
+#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME 0x00000400
+#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME 0x00000800
+#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME 0x00001000
+#define GNSS_SV_MEAS_HEADER_HAS_GLO_SYSTEM_TIME 0x00002000
+#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME_EXT 0x00004000
+#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME_EXT 0x00008000
+#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME_EXT 0x00010000
+#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME_EXT 0x00020000
typedef struct
{
size_t size;
- uint8_t seqNum;
- /**< Current message Number */
- uint8_t maxMessageNum;
- /**< Maximum number of message that will be sent for present time epoch. */
+ // see defines in GNSS_SV_MEAS_HEADER_HAS_XXX_XXX
+ uint64_t flags;
- bool leapSecValid;
Gnss_LeapSecondInfoStructType leapSec;
- Gnss_InterSystemBiasStructType gpsGloInterSystemBias;
+ Gnss_LocRcvrClockFrequencyInfoStructType clockFreq; /* Freq */
- Gnss_InterSystemBiasStructType gpsBdsInterSystemBias;
+ Gnss_ApTimeStampStructType apBootTimeStamp;
+ Gnss_InterSystemBiasStructType gpsGloInterSystemBias;
+ Gnss_InterSystemBiasStructType gpsBdsInterSystemBias;
Gnss_InterSystemBiasStructType gpsGalInterSystemBias;
-
Gnss_InterSystemBiasStructType bdsGloInterSystemBias;
-
Gnss_InterSystemBiasStructType galGloInterSystemBias;
-
Gnss_InterSystemBiasStructType galBdsInterSystemBias;
- bool clockFreqValid;
- Gnss_LocRcvrClockFrequencyInfoStructType clockFreq; /* Freq */
- bool gnssMeasValid;
- Gnss_ClockMeasurementStructType gnssMeas;
- Gnss_ApTimeStampStructType timeStamp;
- /* Extended Time Information - Cumulative Number of Clock Resets */
- uint8_t numClockResets_valid; /**< Must be set to true if numClockResets is being passed */
- uint32_t numClockResets;
- bool gnssSignalTypeMaskValid;
- GnssSignalTypeMask gnssSignalTypeMask;
+ GnssSystemTimeStructType gpsSystemTime;
+ GnssSystemTimeStructType galSystemTime;
+ GnssSystemTimeStructType bdsSystemTime;
+ GnssSystemTimeStructType qzssSystemTime;
+ GnssGloTimeStructType gloSystemTime;
+ /** GPS system RTC time information. */
+ Gnss_LocGnssTimeExtStructType gpsSystemTimeExt;
+ /** GAL system RTC time information. */
+ Gnss_LocGnssTimeExtStructType galSystemTimeExt;
+ /** BDS system RTC time information. */
+ Gnss_LocGnssTimeExtStructType bdsSystemTimeExt;
+ /** QZSS system RTC time information. */
+ Gnss_LocGnssTimeExtStructType qzssSystemTimeExt;
+
+} GnssSvMeasurementHeader;
+
+typedef struct {
+ size_t size;
+ bool isNhz;
+ GnssSvMeasurementHeader svMeasSetHeader;
+ uint32_t svMeasCount;
+ Gnss_SVMeasurementStructType svMeas[GNSS_LOC_SV_MEAS_LIST_MAX_SIZE];
} GnssSvMeasurementSet;
typedef enum